20 lines
No EOL
494 B
JavaScript
20 lines
No EOL
494 B
JavaScript
const express = require('express');
|
|
|
|
// Read the port from the environment if possible
|
|
const port = process.env.PORT || 3000;
|
|
|
|
const server = express();
|
|
|
|
// Set up the static directory to server cssa and other assets
|
|
server.use('/static', express.static('static'));
|
|
|
|
// Root path serves index
|
|
server.get('/', (req, res) => {
|
|
res.sendFile(__dirname + '/html/index.html');
|
|
});
|
|
|
|
// Listen and provide feedback
|
|
server.listen(port, () => {
|
|
console.log(`Server running on port ${port}`);
|
|
}
|
|
); |