Reputation: 133
I am using Express.js, and I can't set the Content-Type header for some reason. I set it to text/html
and it sends with application/octet-stream
anyway. Here is my code:
const express = require("express")
const app = express()
const fs = require("fs")
const Template = require("./Template")
app.get("/", (req, res) => {
res.type("html")
res.send(String(Template.solidify(fs.readFileSync("index.html"))))
})
app.listen(80, () => {
console.log("Listening...")
})
Template.solidify()
just returns what it's given for now. index.html is an empty html file (with head, body, etc.).
Upvotes: 0
Views: 272
Reputation: 133
Update for anybody looking for answers, I just had to clear my browser cache.
I use chrome, and I was able to disable cache while devtools is open by checking the box.
Upvotes: 1