Skip to content

Commit e2db3bd

Browse files
committed
Set up backend and frontend
1 parent c3ed7dd commit e2db3bd

21 files changed

+5204
-0
lines changed

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
26+
# Environment files
27+
.env

backend/question-service/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const express = require("express");
2+
const dotenv = require("dotenv");
3+
const path = require("path");
4+
5+
const envFilePath = path.join(
6+
path.resolve(path.dirname(path.dirname(__dirname))),
7+
".env"
8+
);
9+
10+
dotenv.config({ path: envFilePath });
11+
12+
const app = express();
13+
14+
const PORT = process.env.QUESTION_SERVICE_PORT || 3000;
15+
16+
app.get("/", (req, res) => {
17+
res.json({ message: "Hello World from question-service" });
18+
});
19+
20+
app.listen(PORT, () => console.log(`Listening on port ${PORT}`));

0 commit comments

Comments
 (0)