Answer the question
In order to leave comments, you need to log in
Why is express not serving files?
Hello. I wrote a simple script for returning statics:
const http = require('http'),
express = require('express'),
app = express();
app.use('/', express.static(__dirname + '/front-end/index.html'));
app.use('/add', express.static(__dirname + '/front-end/add.html'));
app.listen(8080);
Answer the question
In order to leave comments, you need to log in
const http = require('http'),
express = require('express'),
app = express();
app.use(express.static(__dirname + '/front-end'));
app.use('/add', express.static(__dirname + '/front-end/add.html'));
app.listen(8080);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question