Skip to content

Commit fb6d2af

Browse files
committed
oops
1 parent a4aa6e4 commit fb6d2af

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export const config = {
1+
const config = {
22
passwordProtect: false,
33
password: "password"
4-
}
4+
}
5+
export default config;

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import http from 'node:http'
44
import { createBareServer } from '@tomphttp/bare-server-node'
55
import path from 'node:path'
66
import cors from 'cors'
7-
import { config } from './config.js'
7+
import config from './config.js'
88
const __dirname = process.cwd()
99
const server = http.createServer()
1010
const 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
}
2321
app.use(express.json())
2422
app.use(express.urlencoded({ extended: true }))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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",

0 commit comments

Comments
 (0)