Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. const express = require('express');
  2. // const https = require('https');
  3. const fs = require('fs');
  4.  
  5. const PORT = 3000;
  6. // const CREDENTIALS = {
  7. // key: fs.readFileSync('ssl.key'),
  8. // cert: fs.readFileSync('ssl.cert')
  9. // };
  10.  
  11. const app = express();
  12.  
  13. app.use(express.static(`${__dirname}/public`))
  14.  
  15. app.get('*', (req, res) => {
  16. res.end(`${__dirname}/public/index.html`);
  17. });
  18.  
  19. // https.createServer(CREDENTIALS, app)
  20.  
  21. app.listen(PORT, () => {
  22. console.log(`You are now listening on port ${PORT}`)
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement