separate process from client
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
"build": "npx tsc",
|
"build": "npx tsc",
|
||||||
"startServer": "node out/serverMain.js",
|
"startServer": "node out/serverMain.js",
|
||||||
"startClient": "node out/clientMain.js",
|
"startClient": "node out/clientMain.js",
|
||||||
|
"startProcess": "node out/processMain.js",
|
||||||
"documentation": "widdershins reference/OpenAPI.yml -o docs/openapi.md --language_tabs javascript:JavaScript:request.",
|
"documentation": "widdershins reference/OpenAPI.yml -o docs/openapi.md --language_tabs javascript:JavaScript:request.",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-5
@@ -5,7 +5,6 @@ import cors from 'cors'
|
|||||||
import client from './client/client'
|
import client from './client/client'
|
||||||
import { dbReady } from './db/db'
|
import { dbReady } from './db/db'
|
||||||
import { cacheReady } from './cache/redis'
|
import { cacheReady } from './cache/redis'
|
||||||
import processAll from './client/process'
|
|
||||||
|
|
||||||
const app = express()
|
const app = express()
|
||||||
const port = 3000
|
const port = 3000
|
||||||
@@ -21,10 +20,8 @@ app.use('/', client)
|
|||||||
|
|
||||||
dbReady().then((e) => {
|
dbReady().then((e) => {
|
||||||
cacheReady().then((e) => {
|
cacheReady().then((e) => {
|
||||||
processAll().then((e) => {
|
app.listen(port, '0.0.0.0', () => {
|
||||||
app.listen(port, '0.0.0.0', () => {
|
console.log(`Tone client api listening on port ${port}`)
|
||||||
console.log(`Tone client api listening on port ${port}`)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import * as dotenv from 'dotenv'
|
||||||
|
dotenv.config()
|
||||||
|
import { dbReady } from './db/db'
|
||||||
|
import { cacheReady } from './cache/redis'
|
||||||
|
import processAll from './client/process'
|
||||||
|
|
||||||
|
dbReady().then((e) => {
|
||||||
|
cacheReady().then((e) => {
|
||||||
|
processAll()
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user