Tell us what’s happening:
The test isn’t passing even though the styles are being applied. Any thoughts?
I have the following code:
var express = require('express');
var app = express();
// Normal usage
app.use(express.static(__dirname + "/public"));
// Assets at the /assets route
app.use("/assets", express.static(__dirname + "/public"));
app.get("/", (req, res) => {
res.sendFile(__dirname + '/views/index.html')
})
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Hello HTML</title>
<link rel="stylesheet" href="/style.css">
</head>
<body>
<h1>Hello, HTML.</h1>
<p>Do not use until Challenge #12</p>
<form action="/name" method="post">
<label>First Name :</label>
<input type="text" name="first" value="John"><br>
<label>Last Name :</label>
<input type="text" name="last" value="Doe"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Your project link(s)
solution: https://boilerplate-express.danielfloyd.repl.co
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36
.
Challenge: Serve Static Assets
Link to the challenge: