mirror of
https://gitee.com/mafgwo/stackedit
synced 2024-11-16 19:57:40 +08:00
21 lines
502 B
JavaScript
21 lines
502 B
JavaScript
const env = require('./config/prod.env');
|
|
|
|
Object.keys(env).forEach((key) => {
|
|
if (!process.env[key]) {
|
|
process.env[key] = JSON.parse(env[key]);
|
|
}
|
|
});
|
|
|
|
const http = require('http');
|
|
const express = require('express');
|
|
|
|
const app = express();
|
|
|
|
require('./server')(app, process.env.SERVE_V4);
|
|
|
|
const port = parseInt(process.env.PORT || 8080, 10);
|
|
const httpServer = http.createServer(app);
|
|
httpServer.listen(port, null, () => {
|
|
console.log(`HTTP server started: http://localhost:${port}`);
|
|
});
|