An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

Grind Template API


Latest Version
Slack
License

# 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).