gradido/frontend/run/server.js
Ulf Gebhardt 00ecc2b999
cleanup run script (frontend)
include new run script(admin)
2022-01-12 21:21:21 +01:00

22 lines
527 B
JavaScript

// Imports
const express = require('express')
const path = require('path')
// Host & Port
const hostname = '127.0.0.1'
const port = process.env.PORT || 3000
// Express Server
const app = express()
// Serve files
app.use(express.static(path.join(__dirname, '../dist')))
// Default to index.html
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '../dist/index.html'))
})
app.listen(port, hostname, () => {
// eslint-disable-next-line no-console
console.log('Listening at http://%s:%s/', hostname, port)
})