Answer the question
In order to leave comments, you need to log in
Node server doesn't see scripts folder?
const express = require('express');
const path = require('path');
const app = express();
const port = 3000;
app.use(express.static(path.join(__dirname, '..', 'app')));
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, '..', 'index.html'));
});
app.listen(port, () => {
console.log('server is runnig');
});
Answer the question
In order to leave comments, you need to log in
Issue resolved.
const express = require('express');
const path = require('path');
const app = express();
const port = 3000;
app.use('/app',express.static(path.join(__dirname, '..', 'app')));
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, '..', 'index.html'));
});
app.listen(port, () => {
console.log('server is running');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question