Help!
I dont know what to do, ive researched and tried different code but i just cannot pass this. The code i have
var express = require('express');
var app = express();
let absolutePath = __dirname + "/views/index.html";
app.use(express.static(__dirname + "/public"))
//app.get("/", (req, res) => {
// res.send("Hello")
//})
app.get("/", (req, res) => {
res.sendFile(absolutePath)
})
app.get("/json", (req, res) => {
res.json({"message": "Hello json"})
})
console.log("Hello World")
What am i doing wrong?
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Challenge: Serve Static Assets
Link to the challenge: