https://github.com/grindjs/example-api
Example API built on Grind/ExpressJS
https://github.com/grindjs/example-api
express expressjs grind-example grind-framework grindjs node nodejs
Last synced: 4 months ago
JSON representation
Example API built on Grind/ExpressJS
- Host: GitHub
- URL: https://github.com/grindjs/example-api
- Owner: grindjs
- License: mit
- Created: 2016-04-03T21:26:40.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-05-22T21:11:24.000Z (about 4 years ago)
- Last Synced: 2025-02-23T18:09:14.734Z (4 months ago)
- Topics: express, expressjs, grind-example, grind-framework, grindjs, node, nodejs
- Language: JavaScript
- Homepage:
- Size: 85 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Grind API Template
The Grind API Template is an example project for building API’s on [Grind](https://github.com/grindjs/grindjs). It’s also used as a template in [Grind Toolkit](https://github.com/grindjs/grindjs/tree/master/packages/toolkit) so you can quickly setup a new API project.
## Installation
```bash
git clone https://github.com/grindjs/example-api.git grind-example-api
cd grind-example-api
yarn install
yarn cli migrate:latest
yarn cli db:seed
```## Running
```bash
# Use `watch` to automatically restart the server on file changes
# Watch is recommended for development
yarn cli watch# Use `serve --cluster` to launch a cluster of workers
# Cluster is recommended for production
yarn cli serve --cluster# Use `serve` to launch a single worker
yarn cli serve
```You should now be able to visit [localhost:3000/states](http://localhost:3000/states).
Other URLs:
- Paged: [localhost:3000/states?limit=10](http://localhost:3000/states?limit=10)
- Individual: [localhost:3000/states/ny](http://localhost:3000/states/ny)
- Search: [localhost:3000/states/search?term=new](http://localhost:3000/states/search?term=new)
- Swagger: [petstore.swagger.io/?url=http://localhost:3000/swagger.json](http://petstore.swagger.io/?url=http://localhost:3000/swagger.json)## Documentation
Full documentation for Grind is available on the [Grind website](https://grind.rocks/).
## License
Grind was created by [Shaun Harrison](https://github.com/shnhrrsn) and is made available under the [MIT license](LICENSE).