Is it possible? I would like to set up two different directories to serve static files. Let\'s say /public and /mnt
const express = require('express');
const path = require('path');
const pagesPath = path.join(__dirname, '/cheatsheet');
const cssPath = path.join(__dirname, '/stylesheet');
const port = process.env.PORT || 3000;
var app = express();
app.use("/cheatsheet" ,express.static(pagesPath));
app.use("/stylesheet",express.static(cssPath));
app.get('/',(request,response)=>{
response.send('Hello CSS!!!');
});
app.get('/bad',(request,response)=>{
response.send({error: 'Bad Request'});
});
app.listen(port, ()=> {
console.log(`Server is running on Port ${port}` );
console.log(__dirname);
});
// folder structure
/cheatsheet/index.html
/stylesheet/style.css