Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Big Bang!
  • Loading branch information
rychkog committed Jun 8, 2019
0 parents commit 31d178d
Show file tree
Hide file tree
Showing 24 changed files with 1,659 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .gitignore
@@ -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
72 changes: 72 additions & 0 deletions README.md
@@ -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
```

0 comments on commit 31d178d

Please sign in to comment.