feat: docker setup & deployment

This commit is contained in:
wancat committed 2023-10-14 19:43:13 +08:00
1 parent ad08bde4c4
commit 20927fe8aa
10 files changed
+87 -8

No files matched your search

+7 -1
View File
@@ -1,3 +1,9 @@
export default {
const config = {
host: process.env.HOST || 'localhost',
port: process.env.PORT || 3001,
db: process.env.MONGO_URL || 'mongodb://localhost:27017/odyssey-test',
}
config.baseUrl = process.env.BASE_URL || `http://${config.host}:${config.port}`
export default config
+2 -2
View File
@@ -16,8 +16,8 @@ async function main() {
app.use(router)
app.use(express.static('./public'))
app.listen(3001, () => {
console.log('Server started on http://localhost:3001')
app.listen(config.port, config.host, () => {
console.log(`Server started on ${config.baseUrl}`)
})
}