Skip to content

Commit

Permalink
Create base api
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielBehling committed Nov 7, 2024
1 parent 05e1641 commit 3eeb925
Show file tree
Hide file tree
Showing 4 changed files with 813 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
node_modules
24 changes: 24 additions & 0 deletions api/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const express = require("express");
const app = express();

const PORT = process.env.PORT || 3000;

app.get("/status", (req, res) => {
res.status(200).json({ status: "ok" });
});

app.get("/products", (req, res) => {});
app.get("/product/:id", (req, res) => {});
app.post("/product", (req, res) => {});

app.get("/posts", (req, res) => {});
app.get("/post/:id", (req, res) => {});
app.post("/post", (req, res) => {});

app.listen(PORT, (error) => {
if (!error) {
console.log("Open on port: ", PORT);
} else {
console.error("Error occurred on: ", error);
}
});
Loading

0 comments on commit 3eeb925

Please sign in to comment.