From db5a0b27f9ceda51f391c6d86553318c8007dd4b Mon Sep 17 00:00:00 2001 From: Aljaz S Date: Tue, 16 Nov 2021 21:17:55 +0100 Subject: [PATCH] server index.html and style.css on port 80 --- src/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/index.js diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..215d95b --- /dev/null +++ b/src/index.js @@ -0,0 +1,13 @@ +import express from 'express' +import path from 'path' +import { dirname } from 'path' +import { fileURLToPath } from 'url' + +const app = express() +const __dirname = dirname(fileURLToPath(import.meta.url)) + + +app.get('/', (req, res) => res.sendFile(path.join(__dirname, 'index.html'))) +app.get('/style.css', (req, res) => res.sendFile(path.join(__dirname, 'style.css'))) + +app.listen(80, () => console.log(`UPN-QR started on port 80`)) \ No newline at end of file