diff options
Diffstat (limited to 'src/internal-server')
-rw-r--r-- | src/internal-server/start.ts (renamed from src/internal-server/start.js) | 18 | ||||
-rw-r--r-- | src/internal-server/test.ts (renamed from src/internal-server/test.js) | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/internal-server/start.js b/src/internal-server/start.ts index 5ccc1330e..392f7cf41 100644 --- a/src/internal-server/start.js +++ b/src/internal-server/start.ts | |||
@@ -15,16 +15,16 @@ | |||
15 | | Make sure to pass a relative path from the project root. | 15 | | Make sure to pass a relative path from the project root. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | const fold = require('@adonisjs/fold'); | 18 | import fold from '@adonisjs/fold'; |
19 | const { Ignitor } = require('@adonisjs/ignitor'); | 19 | import { Ignitor } from '@adonisjs/ignitor'; |
20 | const fs = require('fs-extra'); | 20 | import fs from 'fs-extra'; |
21 | const path = require('path'); | 21 | import path from 'path'; |
22 | const { LOCAL_HOSTNAME } = require('../config'); | 22 | import { LOCAL_HOSTNAME } from '../config'; |
23 | const { isWindows } = require('../environment'); | 23 | import { isWindows } from '../environment'; |
24 | 24 | ||
25 | process.env.ENV_PATH = path.join(__dirname, 'env.ini'); | 25 | process.env.ENV_PATH = path.join(__dirname, 'env.ini'); |
26 | 26 | ||
27 | module.exports = async (userPath, port) => { | 27 | export const server = async (userPath: string, port: number) => { |
28 | const dbPath = path.join(userPath, 'server.sqlite'); | 28 | const dbPath = path.join(userPath, 'server.sqlite'); |
29 | const dbTemplatePath = path.join(__dirname, 'database', 'template.sqlite'); | 29 | const dbTemplatePath = path.join(__dirname, 'database', 'template.sqlite'); |
30 | 30 | ||
@@ -45,7 +45,7 @@ module.exports = async (userPath, port) => { | |||
45 | process.env.DB_PATH = dbPath; | 45 | process.env.DB_PATH = dbPath; |
46 | process.env.USER_PATH = userPath; | 46 | process.env.USER_PATH = userPath; |
47 | process.env.HOST = LOCAL_HOSTNAME; | 47 | process.env.HOST = LOCAL_HOSTNAME; |
48 | process.env.PORT = port; | 48 | process.env.PORT = port.toString(); |
49 | 49 | ||
50 | new Ignitor(fold).appRoot(__dirname).fireHttpServer().catch(console.error); // eslint-disable-line no-console | 50 | new Ignitor(fold).appRoot(__dirname).fireHttpServer().catch(console.error); |
51 | }; | 51 | }; |
diff --git a/src/internal-server/test.js b/src/internal-server/test.ts index ef85743f3..437a2813b 100644 --- a/src/internal-server/test.js +++ b/src/internal-server/test.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | const path = require('path'); | 1 | import path from 'path'; |
2 | const fs = require('fs-extra'); | 2 | import fs from 'fs-extra'; |
3 | const server = require('./start'); | 3 | import { server } from './start'; |
4 | 4 | ||
5 | const dummyUserFolder = path.join(__dirname, 'user_data'); | 5 | const dummyUserFolder = path.join(__dirname, 'user_data'); |
6 | 6 | ||