Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Big Bang!
- Loading branch information
0 parents
commit 31d178d
Showing
24 changed files
with
1,659 additions
and
0 deletions.
There are no files selected for viewing
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,21 @@ | ||
| # dependencies | ||
| /node_modules | ||
|
|
||
| # IDE | ||
| /.idea | ||
| /.awcache | ||
| /.vscode | ||
|
|
||
| # misc | ||
| npm-debug.log | ||
|
|
||
| # example | ||
| /quick-start | ||
|
|
||
| # tests | ||
| /test | ||
| /coverage | ||
| /.nyc_output | ||
|
|
||
| # dist | ||
| /dist |
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,72 @@ | ||
| # Reducing mental fatigue: NestJS + Objection.js | ||
|
|
||
| ## Hot to run | ||
| - `npm i` | ||
| - `npm run start` | ||
|
|
||
| API is accessible at `http://localhost:3001` | ||
|
|
||
| ## Example API requests | ||
| ### Themes | ||
| ```bash | ||
| # findAll | ||
| curl http://localhost:3001/api/themes | ||
|
|
||
| # findOne | ||
| curl http://localhost:3001/api/themes/1 | ||
|
|
||
| # create | ||
| curl -X POST http://localhost:3001/api/themes -d '{ "name": "my" }' -H "Content-Type: application/json" | ||
|
|
||
| # update | ||
| curl -X PUT http://localhost:3001/api/themes/6 -d '{ "name": "baz", "fontFamily": "DejaVu Sans Mono" }' -H "Content-Type: application/json" | ||
|
|
||
| # delete | ||
| curl -X DELETE http://localhost:3001/api/themes/6 | ||
| ``` | ||
|
|
||
| ### Tags | ||
| ```bash | ||
| # findAll | ||
| curl http://localhost:3001/api/tags | ||
|
|
||
| # findOne | ||
| curl http://localhost:3001/api/tags/1 | ||
|
|
||
| # create | ||
| curl -X POST http://localhost:3001/api/tags -d '{ "name": "foobar" }' -H "Content-Type: application/json" | ||
|
|
||
| # update | ||
| curl -X PUT http://localhost:3001/api/tags/6 -d '{ "name": "foobar42" }' -H "Content-Type: application/json" | ||
|
|
||
| # delete | ||
| curl -X DELETE http://localhost:3001/api/tags/6 | ||
| ``` | ||
|
|
||
| ### Notes | ||
| ```bash | ||
| # findAll | ||
| curl http://localhost:3001/api/notes | ||
|
|
||
| # findOne | ||
| curl http://localhost:3001/api/notes/1 | ||
|
|
||
| # create | ||
| curl -X POST http://localhost:3001/api/notes -d '{ "text": "foobar", "themeId": 2 }' -H "Content-Type: application/json" | ||
|
|
||
| # update | ||
| curl -X PUT http://localhost:3001/api/notes/1 -d '{ "text": "hello42" }' -H "Content-Type: application/json" | ||
|
|
||
| # delete | ||
| curl -X DELETE http://localhost:3001/api/notes/2 | ||
|
|
||
| # setTheme | ||
| curl -X PUT http://localhost:3001/api/notes/1/theme/6 | ||
|
|
||
| # addTag | ||
| curl -X PUT http://localhost:3001/api/notes/1/tags/6 | ||
|
|
||
| # removeTag | ||
| curl -X DELETE http://localhost:3001/api/notes/1/tags/6 | ||
| ``` | ||
|
|
Oops, something went wrong.