aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/start.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/start.js')
-rw-r--r--src/server/start.js41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/server/start.js b/src/server/start.js
deleted file mode 100644
index 34b2cb5fa..000000000
--- a/src/server/start.js
+++ /dev/null
@@ -1,41 +0,0 @@
1
2/*
3|--------------------------------------------------------------------------
4| Http server
5|--------------------------------------------------------------------------
6|
7| This file bootstraps Adonisjs to start the HTTP server. You are free to
8| customize the process of booting the http server.
9|
10| """ Loading ace commands """
11| At times you may want to load ace commands when starting the HTTP server.
12| Same can be done by chaining `loadCommands()` method after
13|
14| """ Preloading files """
15| Also you can preload files by calling `preLoad('path/to/file')` method.
16| Make sure to pass a relative path from the project root.
17*/
18const path = require('path');
19const fs = require('fs-extra');
20
21process.env.ENV_PATH = path.join(__dirname, 'env.ini');
22
23const { Ignitor } = require('@adonisjs/ignitor');
24const fold = require('@adonisjs/fold');
25
26module.exports = (dbPath, port) => {
27 if (!fs.existsSync(dbPath)) {
28 fs.copySync(
29 path.join(__dirname, 'database', 'template.sqlite'),
30 dbPath,
31 );
32 }
33
34 process.env.DB_PATH = dbPath;
35 process.env.PORT = port;
36
37 new Ignitor(fold)
38 .appRoot(__dirname)
39 .fireHttpServer()
40 .catch(console.error); // eslint-disable-line no-console
41};