Get a basic REST service (for testing purposes) up an running in minutes.
216
Get a basic REST service (for testing purposes) up an running in minutes.
easy-rest-test enables you to provide a REST service within minutes based on a few given .csv files. Extend your REST service by just adding additional .csv files ...
There are only a few steps you need to follow:
git clone [email protected]:stefanwalther/easy-rest-test.git)npm install./data/ folder.npm run startYour .csv files are now exposed as a REST endpoint, e.g.:
./data/sales-data.csvhttp://localhost:3000/sales-dataThe following endpoints are available:
<server-url>/health-check - Health check for the entire service.<server-url>/api-docs - Swagger / OpenAPI documentation (not implemented, yet).For each of the datasets (right now only .csv files) you have provided, the following endpoints are exposed:
<server-url>/:dataset - e.g. http://localhost:3000/sales-data for the file ./data/sales-data.csv.<server-url>/file/:dataset - to download the entire file.<server-url>/:dataset can be used with the following options:
delay - Serve the response with a delay of n milliseconds, e.g /sales-data?delay=2000.The service can be configure by defining the following environment variables:
PORT - Set the port being used by the service, defaults to 3000.NODE_ENV - Set the environment target, can be one of test, development or production. Defaults to development.The entire idea of this solution is to deploy a REST service with some basic data (e.g. for testing purposes) within less than a minute:
my-rest-serviceCreate app)Deploy, choose Deployment method and select GitHubConnectEnable Automatic Deploys orDeploy Branchhttps://my-rest-service.herokuapp.com/sales-dataUsing docker run:
$ docker run -it stefanwalther/easy-rest-test
Using docker-compose:
$ docker-compose up
Right now only .csv files are supported and placed into the ./data folder.
;) as a delimiterStefan Walther
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. The process for contributing is outlined below:
I cannot guarantee that I will merge all PRs but I will evaluate them all.
MIT
This file was generated by verb-generate-readme, v0.6.0, on January 18, 2019.
Content type
Image
Digest
Size
32.7 MB
Last updated
about 7 years ago
docker pull stefanwalther/easy-rest-test