File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1- export const config = {
1+ const config = {
22 passwordProtect : false ,
33 password : "password"
4- }
4+ }
5+ export default config ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import http from 'node:http'
44import { createBareServer } from '@tomphttp/bare-server-node'
55import path from 'node:path'
66import cors from 'cors'
7- import { config } from './config.js'
7+ import config from './config.js'
88const __dirname = process . cwd ( )
99const server = http . createServer ( )
1010const app = express ( server )
@@ -14,11 +14,9 @@ if (config.passwordProtect) {
1414 console . log ( "Password protection is enabled. Username is 'interstellar'." )
1515 console . log ( "Password is: " + config . password )
1616 app . use ( basicAuth ( {
17- users : { "interstellar" : config . password } ,
17+ users : { "interstellar" : password } ,
1818 challenge : true
1919 } ) )
20- } else {
21- console . log ( "Password protection is disabled." )
2220}
2321app . use ( express . json ( ) )
2422app . use ( express . urlencoded ( { extended : true } ) )
Original file line number Diff line number Diff line change 88 },
99 "scripts" : {
1010 "start" : " node index.js" ,
11- "format" : " npx prettier . --write" ,
11+ "format" : " npx prettier . --write"
1212 },
1313 "author" : " " ,
1414 "license" : " GPL-3.0-or-later" ,
You can’t perform that action at this time.
0 commit comments