Skip to content

Commit

Permalink
updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
LordFarquaadtheCreator committed Aug 5, 2024
1 parent 3e74403 commit b603b35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ Server is built with Node.js and Express. Provides endpoints for managing a coll
## How to use
Creating, Reading and Updating can be done from the database (default approach) endpoints. Only reading can be done for the local JSON file.

## Endpoints for DB
## AUTH
In order to `POST` or `PUT` data to the database, you must provide **Basic Auth**. *Only system admins and active developers have access to this.*
- Username is your name (case doesn't matter)
- Password is your API Key provided

## Endpoints for DB
### Get projects
`/projects/get`

Expand All @@ -23,6 +27,9 @@ Filters are stackable, meaning you can do something similar to:
`/projects/get?team=John&cohort=1&team=Jane`
This will return all projects that have John **AND** Jane in their team and are in cohort 1. You can stack as many filters as you want but be aware that the more filters you add, the more specific the query will be, meaning it might return no results.

*Tip:* To get all projects leave `get` as blank


### Post new projects
`/projects/add`

Expand Down
1 change: 1 addition & 0 deletions middlewares/authorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const authorize = function () {
if (result.rows.length === 0) {
return res.status(401).json({ message: "Invalid name or key!" });
}

next();
}
catch (e: any) {
Expand Down

0 comments on commit b603b35

Please sign in to comment.