Answer the question
In order to leave comments, you need to log in
Why does the server not see the public subdirectory when making a get request - 404 error?
On server
app.set('port', process.env.PORT || 3000);
app.use(express.static(__dirname + '/public'));
app.use(bodyParser.text({ extended: true })); //было true
app.get('/', function(req, res){
res.render('home');
});
app.get('/article/:id', function(req, res){
article_create(req.params.id);
res.render('home');
});
app.use(express.static(__dirname + '/public'));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question