-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eecd5eb
commit ec671b0
Showing
10 changed files
with
293 additions
and
112 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RequestHandler } from "express"; | ||
|
||
export const PingHandler: RequestHandler = (req, res) => { | ||
res.status(200).send("Ping success!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import express, { Express } from "express"; | ||
import cors from "cors"; | ||
import dotenv from "dotenv"; | ||
import pingRoute from "./routes/ping"; | ||
|
||
dotenv.config(); | ||
|
||
const app: Express = express(); | ||
const port = process.env.PORT || 9000; | ||
|
||
// Middleware | ||
app.use(express.json()); | ||
app.use(cors()); | ||
|
||
app.use(pingRoute); | ||
|
||
app.listen(port, () => { | ||
console.log(`Server successfully started on port ${port}`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Router } from "express"; | ||
import { PingHandler } from "../controllers/ping"; | ||
|
||
const router = Router(); | ||
|
||
router.get("/ping", PingHandler); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ npm-debug.log | |
build | ||
.git | ||
*.md | ||
.gitignore | ||
.gitignore | ||
.env.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### TODO: make private | ||
|
||
# Backend | ||
NEXT_PUBLIC_BACKEND_HOST=localhost | ||
NEXT_PUBLIC_BACKEND_PORT=9000 |
Oops, something went wrong.