npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

easy-rest-test

v0.1.0

Published

Get a basic REST service (for testing purposes) up an running in minutes.

Downloads

3

Readme

easy-rest-test

Get a basic REST service (for testing purposes) up an running in minutes.

CircleCI


Purpose

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

Usage

There are only a few steps you need to follow:

  • Clone the repository (git clone [email protected]:stefanwalther/easy-rest-test.git)
  • Do an npm install
  • Place the .csv file you want to expose through REST in the ./data/ folder.
  • Start the service by running npm run start

Your .csv files are now exposed as a REST endpoint, e.g.:

  • The content of the file ./data/sales-data.csv
  • Is now available at http://localhost:3000/sales-data

Endpoints

The following endpoints are available:

Reserved endpoints

  • <server-url>/health-check - Health check for the entire service.
  • <server-url>/api-docs - Swagger / OpenAPI documentation (not implemented, yet).

Endpoints based on the files your are providing

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.

Deployment

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:

  • Make sure you have a Heroku account
  • Create a new heroku app
  • Give it a name, e.g my-rest-service
  • Create the app (Create app)
  • Under your newly created app, Deploy, choose Deployment method and select GitHub
  • Enter the name of your GitHub repository and then click Connect
  • That's it, deploy your service by
    • Enable Automatic Deploys or
    • manually using Deploy Branch
  • Access one of your data-sources by hitting e.g https://my-rest-service.herokuapp.com/sales-data

File-Types

Right now only .csv files are supported and placed into the ./data folder.

Conventions for .csv files

  • The .csv file contains a header
  • The .csv file uses semicolon (;) as a delimiter

Roadmap

This is currently a very early iteration of the basic idea of "exposing .csv files through REST".
Any feedback is very appreciated!
So far the following additions are planned:

  • [ ] (feat): Error handling in case of invalid .csv files
  • [ ] (feat): Expose datasets via OpenApi/Swagger
  • [ ] (feat): HATEOAS links
  • [ ] (feat): In memory storage of datasets
  • [ ] (feat): Support paging
  • [ ] (feat): Support different authentication methods
  • [ ] (ci): Docker Image
  • [x] (ci): CircleCI Tests
  • [ ] (test): More integration tests
  • [ ] (docs): Instructions how to deploy within minutes to heroku & Co.
  • [ ] (test): Coverage report

About

Author

Stefan Walther

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. The process for contributing is outlined below:

  1. Create a fork of the project
  2. Work on whatever bug or feature you wish
  3. Create a pull request (PR)

I cannot guarantee that I will merge all PRs but I will evaluate them all.

License

MIT


This file was generated by verb-generate-readme, v0.6.0, on January 11, 2019.