vikunja-frontend/scripts/serve-dist.js
konrad a08306d612 Add vite (#416)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/416
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-07-25 13:27:15 +00:00

16 lines
430 B
JavaScript

const path = require('path')
const express = require('express')
const app = express()
const p = path.join(__dirname, '..', 'dist-dev')
const port = 5000
app.use(express.static(p))
// Handle urls set by the frontend
app.get('*', (request, response, next) => {
response.sendFile(`${p}/index.html`)
})
app.listen(port, '127.0.0.1', () => {
console.log(`Serving files from ${p}`)
console.log(`Server started on port ${port}`)
})