Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting get profile endpoint to be authenticated #13

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions LOCAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
curl -X POST \
-H 'Content-Type: application/json' \
-d '{"email": "artur@polkadot.education", "password": "artur123", "name": "Artur Gontijo"}' \
http://0.0.0.0:4000/user | jq .
http://0.0.0.0:4000/users | jq .

// Get User
curl -X GET \
-H 'Content-Type: application/json' \
http://0.0.0.0:4000/user?userId=66a0413645c44de68c1307a1 | jq .
http://0.0.0.0:4000/users/66a0413645c44de68c1307a1 | jq .

// Delete User
curl -X DELETE \
-H 'Content-Type: application/json' \
-d '{"email": "artur@polkadot.education"}' \
http://0.0.0.0:4000/user | jq .
http://0.0.0.0:4000/users | jq .
```
2 changes: 1 addition & 1 deletion src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const router = (app: Express) => {

// Users
app.post("/users", createUser);
app.get("/users/:id", getUser);
app.get("/users/:id", [corsConfig(), authMiddleware], getUser);
app.put("/users/:id", [corsConfig(), authMiddleware], updateUser);
app.delete("/users/:id", [corsConfig(), authMiddleware], deleteUser);
app.post("/users/login", loginUser);
Expand Down
Loading