fix: some messages were printed before greetings

Massimo Melina committed Mar 10, 2022 at 17:27 UTC 9ca4ca1de492b35a93c28e30af254a3a9b47443d
2 files changed +10 -9
server/src/const.ts
+9
@@ -24,3 +24,12 @@ export const FORBIDDEN = 403
24
25 export const IS_WINDOWS = process.platform === 'win32'
26
27 +// we want this to be the first stuff to be printed, then we print it in this module, that is executed at the beginning
28 +if (DEV) console.clear()
29 +console.log(`HFS ~ HTTP File Server - Copyright 2020-2021, Massimo Melina <a@rejetto.com>`)
30 +console.log(`License https://www.gnu.org/licenses/gpl-3.0.txt`)
31 +console.log('started', HFS_STARTED.toLocaleString(), DEV)
32 +console.log('version', VERSION||'-')
33 +console.log('build', BUILD_TIMESTAMP||'-')
34 +console.log('cwd', process.cwd())
35 +
server/src/index.ts
+1 -9
@@ -3,7 +3,7 @@
3 import Koa from 'koa'
4 import mount from 'koa-mount'
5 import { apiMiddleware } from './apiMiddleware'
6 -import { API_URI, BUILD_TIMESTAMP, DEV, HFS_STARTED, VERSION} from './const'
6 +import { API_URI, DEV } from './const'
7 import { frontEndApis } from './frontEndApis'
8 import { log } from './log'
9 import { pluginsMiddleware } from './plugins'
@@ -13,14 +13,6 @@ import './listen'
13 import { serveAdminFiles } from './serveFrontend'
14 import { adminApis } from './adminApis'
15
16 -if (DEV) console.clear()
17 -console.log(`HFS ~ HTTP File Server - Copyright 2020-2021, Massimo Melina <a@rejetto.com>`)
18 -console.log(`License https://www.gnu.org/licenses/gpl-3.0.txt`)
19 -console.log('started', HFS_STARTED.toLocaleString(), DEV)
20 -console.log('version', VERSION||'-')
21 -console.log('build', BUILD_TIMESTAMP||'-')
22 -console.log('cwd', process.cwd())
23 -
16 const keys = ['hfs-keys-test']
17
18 export const adminApp = new Koa({ keys })