-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
44 lines (33 loc) · 1.02 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'use strict'
// Use ES6 module syntax with node.js
require("@babel/register")({
plugins: [
"@babel/plugin-transform-runtime",
"dynamic-import-node",
[
"css-modules-transform",
{
"preprocessCss": "api/render/preprocessor.js",
"extensions": [
".css",
".less"
]
}
]
]
})
const config = require('../gensrc/config').default
// define some global vars for server side rendering
global.document = {documentElement: {}}
global._app_ = {lang: config.DEFAULT_LANGUAGE || 'en', ssr: true}
// Entry point for our server
const server = require('./api/server')
server.start()
require('./server/server')
/*const exec = require('child_process').exec
const childApi = exec('npm run api')
const childServer = exec('npm run client')
childApi.stderr.pipe(process.stderr)
childApi.stdout.pipe(process.stdout)
childServer.stderr.pipe(process.stderr)
childServer.stdout.pipe(process.stdout)*/