server index.html and style.css on port 80

This commit is contained in:
Aljaz S
2021-11-16 21:17:55 +01:00
parent 8e072824e4
commit db5a0b27f9

13
src/index.js Normal file
View File

@@ -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`))