Skip to content

Commit 7b61d99

Browse files
Update server.js (#1438)
1 parent e4a50a1 commit 7b61d99

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const allowedOrigins = [
1717
"https://example.com"
1818
];
1919

20+
const path = require('path');
21+
app.use(express.static(path.join(__dirname)));
22+
2023
// CORS configuration
2124
app.use(cors({
2225
origin: function (origin, callback) {
@@ -38,7 +41,7 @@ app.use(express.json());
3841

3942
// Test route
4043
app.get("/", (req, res) => {
41-
res.send("GitHub OAuth backend is running!");
44+
res.sendFile(path.join(__dirname, 'index.html'));
4245
});
4346

4447
// GitHub OAuth route
@@ -126,4 +129,4 @@ app.get("/api/auth/github/getUser", async (req, res) => {
126129
// Start server
127130
app.listen(port, () => {
128131
console.log(`Server running at http://localhost:${port}`);
129-
});
132+
});

0 commit comments

Comments
 (0)