Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express');
- // const https = require('https');
- const fs = require('fs');
- const PORT = 3000;
- // const CREDENTIALS = {
- // key: fs.readFileSync('ssl.key'),
- // cert: fs.readFileSync('ssl.cert')
- // };
- const app = express();
- app.use(express.static(`${__dirname}/public`))
- app.get('*', (req, res) => {
- res.end(`${__dirname}/public/index.html`);
- });
- // https.createServer(CREDENTIALS, app)
- app.listen(PORT, () => {
- console.log(`You are now listening on port ${PORT}`)
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement