🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

t-rest

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

t-rest

Start a simple rest api for prototyping purposes.

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

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.

MIT © Aloïs Deniel

Keywords

t-rest

FAQs

Package last updated on 06 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts