-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.mjs
36 lines (30 loc) · 1.74 KB
/
index.mjs
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
/*************************************************************************
* Copyright (c) 2019 - 2019 Yichao Yu <[email protected]> *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 3.0 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. If not, *
* see <http://www.gnu.org/licenses/>. *
*************************************************************************/
"use strict";
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
process.env.NODE_ENV = 'production';
process.env.NEXT_DIST_DIR = 'exec';
process.env.NODE_CONFIG_DIR = 'conf';
process.env.LABCTRL_LIB_DIR = path.resolve(__dirname, 'addon');
process.chdir(__dirname);
const { default: Server } = await import('./server/server.js');
const server = new Server();
server.listen(8000, 'localhost');