Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuuu/niko_api
https://github.com/yuuu/niko_api
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/yuuu/niko_api
- Owner: yuuu
- Created: 2023-04-23T20:59:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-23T21:00:02.000Z (over 1 year ago)
- Last Synced: 2024-04-22T14:56:01.981Z (8 months ago)
- Language: Ruby
- Size: 91.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
## APIの起動
```
bundle install
bin/rails db:create db:migrate
bin/rails s
```## APIのテスト方法
### ユーザー登録
```sh
curl localhost:3000/api/v1/auth -X POST -d '{"email":"[email protected]", "password":"password", "password_confirmation": "password"}' -H "content-type:application/json" -i
```### ログイン
```sh
curl localhost:3000/api/v1/auth/sign_in -X POST -d '{"email":"[email protected]", "password":"password"}' -H "content-type:application/json" -i
```### 気分一覧
```sh
curl localhost:3000/api/v1/nikos -H "content-type:application/json" -i
```### 気分登録
```sh
curl localhost:3000/api/v1/nikos -X POST -d '{"mood": "good", "date": "2023-04-23", "comment": "hello world."}' -H "content-type:application/json" -H "uid:[email protected]" -H "client:$CLIENT" -H "access-token:$TOKEN" -i
```