Skip to content

Commit 5ee0824

Browse files
committed
Cleaned up commit history
1 parent 4887c0a commit 5ee0824

File tree

9 files changed

+8745
-19
lines changed

9 files changed

+8745
-19
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.env
22
node_modules
3+
data/
4+
services/predict-addon/build
35
.snyk

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ THREAD_CNT: Number of threads for prediction.(default: 4)
184184
185185
## Browser extension
186186
187-
Current only chrome browser is suported. It uses manifest V3. See [this](https://developer.chrome.com/docs/extensions/mv3/getstarted/) for getting started with extension development. Source code for the extension is in `./chrome-extension`.
187+
Current only chrome browser is supported. It uses manifest V3. See [this](https://developer.chrome.com/docs/extensions/mv3/getstarted/) for getting started with extension development. Source code for the extension is in `./chrome-extension`.
188188
189189
## Contributing
190190
@@ -207,6 +207,17 @@ For contributing in the source code, please follow these steps:
207207
```
208208
- Open a Pull Request
209209
210+
# Contributors
211+
<a href="https://github.com/SysSn13/leetcode-rating-predictor/graphs/contributors">
212+
<img src="https://contrib.rocks/image?repo=SysSn13/leetcode-rating-predictor" />
213+
</a>
214+
215+
# Stargazers
216+
[![Stargazers repo roster for @SysSn13/leetcode-rating-predictor](https://reporoster.com/stars/SysSn13/leetcode-rating-predictor)](https://github.com/SysSn13/leetcode-rating-predictor/stargazers)
217+
210218
# License
211219
212220
Distributed under the MIT License. See [LICENSE](/LICENSE) for more information.
221+
222+
<br>
223+
<p align="center"><a href="https://github.com/SysSn13/leetcode-rating-predictor#"><img src="http://randojs.com/images/backToTopButton.png" alt="Back to top" height="29"/></a></p>

background.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ const initScheduler = async () => {
3737

3838
initScheduler();
3939

40+
serverAdapter.getRouter();
41+
4042
module.exports.bullBoardServerAdapter = serverAdapter;

main.js

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,42 @@ app.use(limiter);
3232
// body limit
3333
app.use(express.json({ limit: "10kb" }));
3434

35+
app.set("view engine", "ejs");
36+
app.set("views", __dirname + "/views");
37+
app.use(bodyParser.urlencoded({ extended: true }));
38+
app.use(express.static("public"));
39+
3540
// background
3641
if (process.env.BACKGROUND == true) {
3742
const { bullBoardServerAdapter } = require("./background");
38-
app.use("/bull-board", bullBoardServerAdapter.getRouter());
43+
const {ensureLoggedIn} = require("connect-ensure-login");
44+
const passport = require('passport');
45+
const session = require('express-session');
46+
app.use(session({secret : 'keyboard cat'}));
47+
app.use(passport.initialize({}));
48+
app.use(passport.session({}));
49+
const authRouter = require("./routes/auth");
50+
app.use("/login", authRouter);
51+
app.use("/bull-board",
52+
ensureLoggedIn('/login'),
53+
bullBoardServerAdapter.getRouter()
54+
);
3955
console.info("BACKGROUND is up.");
4056
}
4157

4258
// web
4359
if (process.env.WEB == true) {
44-
const webRouter = require("./web");
45-
app.set("view engine", "ejs");
46-
app.set("views", __dirname + "/views");
4760
app.set("layout", "layouts/layout");
4861
app.set("layout extractScripts", true);
4962
app.use(expressLayouts);
50-
app.use(bodyParser.urlencoded({ extended: true }));
51-
app.use(express.static("public"));
52-
app.use("/", webRouter);
63+
const unless = require('express-unless');
64+
const webRouter = require("./web");
65+
webRouter.unless = unless;
66+
app.use("/",
67+
webRouter.unless({
68+
path : ['/login', '/bull-board']
69+
}),
70+
);
5371
console.info("WEB is up.");
5472
}
5573

0 commit comments

Comments
 (0)