diff --git a/index.js b/index.js index 6c57fce..ade69f4 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,10 @@ const compression = require( 'compression' ); const express = require( 'express' ); const app = express(); const port = 3000; +const httpPort = 800; +const httpsPort = 4430; +const http = require('http'); +const https = require('https'); // EJS app.set( 'views', './views' ); @@ -87,4 +91,12 @@ app.use( ( req, res, next ) => { app.listen( port, () => { console.log( `Server listening at http://localhost:${port}` ); -} ); \ No newline at end of file +} ); + +http.createServer(app).listen(httpPort, () => { + console.log( `HTTP server listening at http://localhost:${httpPort}` ); +}); + +https.createServer(app).listen(httpsPort, () => { + console.log( `HTTPS server listening at http://localhost:${httpsPort}` ); +}) \ No newline at end of file diff --git a/package.json b/package.json index 41f3446..720b15e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "Info Evry Website", "main": "index.js", "scripts": { - "start": "nodemon --ext \"js,ejs,css\" ." + "start": "node .", + "dev": "nodemon --ext \"js,ejs,css\" ." }, "repository": { "type": "git",