From 29f7a0ef84e29b0073337cefc892a2ece4e4b045 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 16 Jan 2023 14:13:04 +0100 Subject: [PATCH] initial server setup --- index.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/index.js b/index.js index e69de29..56c803e 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,22 @@ +const fs = require('fs'); +const http = require('http'); +const express = require('express'); + +const app = express(); +const clientPath = __dirname+'/../../Websites/TerminalHomepage'; +app.use(express.static(clientPath)); +const server = http.createServer(app); + +app.post('/message') + +server.on('error', err => { + console.error('Internal server error:', err); +}); + +server.on('close', () => { + console.log("Shutting down ..."); +}); + +server.listen(3000, () => { + console.log("Server running ...") +}); \ No newline at end of file