This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/scripts/serve-dist.js
Dominik Pschenitschni 98cb14a86c
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
feat: change port to 4173
See: https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#default-preview-port
2022-02-18 13:00:20 +01:00

17 lines
430 B
JavaScript

const path = require('path')
const express = require('express')
const app = express()
const p = path.join(__dirname, '..', 'dist-dev')
const port = 4173
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}`)
})