Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/betocantu93/ideas-api
https://github.com/betocantu93/ideas-api
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/betocantu93/ideas-api
- Owner: betocantu93
- Created: 2019-03-01T06:15:59.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T11:57:41.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T05:28:16.965Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ideas
This is a short description of your app.
## Getting Started
### Requirements
1. Ruby
1. PostgreSQL (e.g. [Postgres.app][postgres-app])### Setup
```sh
$ bundle install
$ rails db:setup
```### Development
To generate models, resources, and controllers:
```bash
$ rails generate model widget [fields]
$ rails generate jsonapi:resource widget
$ rails generate jsonapi:controller widget
```### Testing
```sh
$ bin/rspec
```In request tests, you can use the user and access token factories to create test data to access protected resources:
```ruby
user = FactoryBot.create(:user)
token = FactoryBot.create(:access_token, resource_owner_id: user.id).token
headers = {
'Authorization' => "Bearer #{token}",
'Content-Type' => 'application/vnd.api+json',
}# assuming you have a Widget model that belongs to a User
FactoryBot.create(:widget, user: user)get '/widgets', headers: headers
```### Running
```sh
$ rails server
```[postgres-app]: http://postgresapp.com