mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
22 lines
527 B
JavaScript
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)
|
|
})
|