t-rest
Start a simple rest api for prototyping purposes.
Last updated 5 years ago by aloisdeniel .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install t-rest 
SYNC missed versions from official npm registry.

T-Rest

Start a simple rest api for prototyping purposes.

Install

$ npm install -g t-rest

Usage

In the folder of the server, a configuration file config/default.yaml (node-config) is needed with these properties :

  • port (default:3000) : the server port.
  • title (default: "API"): the title of the api.
  • description (default: "A prototype api.") : a short description of the api.
  • version (default: "1.0.0") : the version of the api.
  • root (default: "/api") : the root path of the api.
port: 3000
title: Basic
description: A basic t-rest example of task rest api.
version: 1.0.1
root: /api

A file entity/{route}.yaml containing the schema of each entity you want to expose must be created.

Then simply launch the t-rest server in the folder.

$ npm install -g t-rest
$ cd ./myapi
$ t-rest

A user interface is available (thanks to Swagger UI) at the rout path of the server for trying out the api.

Then go to

Examples

Multiple examples are available in the example folder.

Roadmap / ideas

  • Adding references between objects.
  • Cleaning code and documentation.
  • Adding More examples.
  • Adding subdirectories support for more complex routes.
  • Adding simple generators from data sets.

Copyright and license

MIT © Aloïs Deniel

Current Tags

  • 0.1.0                                ...           latest (5 years ago)

1 Versions

  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (17)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |