mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
cleanup run script (frontend)
include new run script(admin)
This commit is contained in:
parent
c0d5fea248
commit
00ecc2b999
@ -1,15 +1,21 @@
|
|||||||
// Imports
|
// Imports
|
||||||
const express = require('express')
|
const express = require('express')
|
||||||
const serveStatic = require('serve-static')
|
const path = require('path')
|
||||||
|
|
||||||
// Port
|
// Host & Port
|
||||||
const port = process.env.PORT || 8080
|
const hostname = '127.0.0.1'
|
||||||
|
const port = process.env.PORT || 3000
|
||||||
|
|
||||||
// Express Server
|
// Express Server
|
||||||
const app = express()
|
const app = express()
|
||||||
// eslint-disable-next-line node/no-path-concat
|
// Serve files
|
||||||
app.use(serveStatic(__dirname + '/../dist'))
|
app.use(express.static(path.join(__dirname, '../dist')))
|
||||||
app.listen(port)
|
// Default to index.html
|
||||||
|
app.get('*', (req, res) => {
|
||||||
|
res.sendFile(path.join(__dirname, '../dist/index.html'))
|
||||||
|
})
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
app.listen(port, hostname, () => {
|
||||||
console.log(`http://admin:${port} server started.`)
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('Listening at http://%s:%s/', hostname, port)
|
||||||
|
})
|
||||||
|
|||||||
@ -1,33 +1,17 @@
|
|||||||
/*
|
|
||||||
// Imports
|
// Imports
|
||||||
const express = require('express')
|
const express = require('express')
|
||||||
const serveStatic = require('serve-static')
|
const path = require('path')
|
||||||
|
|
||||||
// Port
|
// Host & Port
|
||||||
|
const hostname = '127.0.0.1'
|
||||||
const port = process.env.PORT || 3000
|
const port = process.env.PORT || 3000
|
||||||
|
|
||||||
// Express Server
|
// Express Server
|
||||||
const app = express()
|
const app = express()
|
||||||
// eslint-disable-next-line node/no-path-concat
|
// Serve files
|
||||||
app.use(serveStatic(__dirname + '/../dist'))
|
|
||||||
app.listen(port)
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(`http://frontend:${port} server started.`)
|
|
||||||
*/
|
|
||||||
|
|
||||||
const express = require('express')
|
|
||||||
const path = require('path')
|
|
||||||
|
|
||||||
const hostname = '127.0.0.1'
|
|
||||||
const port = process.env.PORT || 3000
|
|
||||||
|
|
||||||
const app = express()
|
|
||||||
app.use(express.static(path.join(__dirname, '../dist')))
|
app.use(express.static(path.join(__dirname, '../dist')))
|
||||||
|
// Default to index.html
|
||||||
app.get('*', (req, res) => {
|
app.get('*', (req, res) => {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log('Request', req)
|
|
||||||
res.sendFile(path.join(__dirname, '../dist/index.html'))
|
res.sendFile(path.join(__dirname, '../dist/index.html'))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user