/ice-openapi-node

A minimalist NodeJS REST API powered by an OpenAPI spec

Primary LanguageTypeScriptMIT LicenseMIT

ice-openapi-node

A minimalist NodeJS REST API powered by an OpenAPI spec

See our blog post about this repository.

Getting started

  1. Generate the OpenAPI spec in the api package.
yarn --cwd packages/api
yarn --cwd packages/api gen
  1. Generate the Typescript client in the api-client package.
yarn --cwd packages/api-client
yarn --cwd packages/api-client gen
  1. Boot up the api
yarn --cwd packages/api dev
  1. Test requests on the api
# get the api spec
curl http://localhost:8080

# register a user
curl -d '{"name":"Rahul Ligma","email":"rahul@twitter.com"}' -H "Content-Type: application/json" -X POST http://localhost:8080/user/register