# t-rest

> Start a simple rest api for prototyping purposes.

Latest version **0.1.0** (published 2015-06-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install t-rest
pnpm add t-rest
yarn add t-rest
bun add t-rest
```

Provides the command `t-rest`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-06-06 |
| First published | 2015-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 17 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Aloïs Deniel |
| Maintainers | aloisdeniel |
| Keywords | t-rest, test, fake, api, rest, prototype, schema |

## Links

- npm: https://www.npmjs.com/package/t-rest
- Repository: git@github.com:aloisdeniel/t-rest
- Homepage: https://github.com/aloisdeniel/t-rest
- Issues: https://github.com/aloisdeniel/t-rest/issues
- npm.io page: https://npm.io/package/t-rest

## Dependencies (17)

- [JSV](https://npm.io/package/JSV.md) ^4.0.2
- [meow](https://npm.io/package/meow.md) ^3.1.0
- [uuid](https://npm.io/package/uuid.md) ^2.0.1
- [lowdb](https://npm.io/package/lowdb.md) ^0.7.3
- [colors](https://npm.io/package/colors.md) ^1.1.0
- [config](https://npm.io/package/config.md) ^1.13.0
- [express](https://npm.io/package/express.md) ^4.12.4
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.3.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.18.4
- [mustache](https://npm.io/package/mustache.md) ^2.0.0
- [commander](https://npm.io/package/commander.md) ^2.8.1
- [pluralize](https://npm.io/package/pluralize.md) ^1.1.2
- [swagger-ui](https://npm.io/package/swagger-ui.md) ^2.1.5-M2
- [body-parser](https://npm.io/package/body-parser.md) ^1.12.4
- [change-case](https://npm.io/package/change-case.md) ^2.3.0
- [require-dir](https://npm.io/package/require-dir.md) ^0.3.0
- [json-schema-faker](https://npm.io/package/json-schema-faker.md) ^0.1.10

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2015-06-06

## README

# T-Rest


Start a simple rest api for prototyping purposes.

## Install

```sh
$ npm install -g t-rest
```

## Usage

In the folder of the server, a configuration file `config/default.yaml` ([node-config](https://github.com/lorenwest/node-config/wiki/Configuration-Files)) 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.

```yaml
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.

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

A user interface is available (thanks to [Swagger UI](https://github.com/swagger-api/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](http://aloisdeniel.github.io)

---
_Source: https://npm.io/package/t-rest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
