File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 11const config = {
2- passwordProtect : false ,
3- password : "password"
2+ challenge : false ,
3+ users : {
4+ // username: 'password', you can add multiple users.
5+ interstellar : 'password' ,
6+ }
47}
58export default config ;
Original file line number Diff line number Diff line change @@ -10,13 +10,10 @@ const server = http.createServer()
1010const app = express ( server )
1111const bareServer = createBareServer ( '/v/' )
1212const PORT = 8080
13- if ( config . passwordProtect ) {
14- console . log ( "Password protection is enabled. Username is 'interstellar'." )
15- console . log ( "Password is: " + config . password )
16- app . use ( basicAuth ( {
17- users : { "interstellar" : password } ,
18- challenge : true
19- } ) )
13+ if ( config . challenge ) {
14+ console . log ( "Password protection is enabled. Usernames are: " + Object . keys ( config . users ) )
15+ console . log ( "Passwords are: " + Object . values ( config . users ) )
16+ app . use ( basicAuth ( config ) )
2017}
2118app . use ( express . json ( ) )
2219app . use ( express . urlencoded ( { extended : true } ) )
You can’t perform that action at this time.
0 commit comments