tverkettider/index.js
2023-04-11 21:05:35 +02:00

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}`);
}
);