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

crustful-server

v1.0.6

Published

Crustful Server a RESTful Mock Server providing endpoint for the Oracle Scott Emp table

Downloads

1

Readme

CrustFul Server

love Open Source Love svg1

GitHub Travis CI npm GitHub GitHub The MIT License HitCount

Crustful Server is developed to provide on-the-fly handy RESTful Mock Server based on the Oracle's Scott emp Table.

It provides GET POST PUT PATCH DELETE OPTIONS HTTP Methods out of box.

Note: This is a Mock Server for RESTful API without the need of any database server. There is a Feature called AutoREST in Oracle Database which also provides a quick way to setup your API. AutoREST requires obviously the database and ORDS to run.

RoadMap

Planning to add the following:

  • Custom JSON Schema OR JSON database to feed data to the server with a custom URI endpoint.

Getting Started

Prerequisites

You would require the following to run the server:

Installing

After Installing Node.js, type the following command in the shell:

npm install crustful-server -g

The -g switch will install the package globally, which will make it available as a shell command in the system.

Running the Server

Quick and Dry Run

Just call the command crustful from the shell and accept the default values.

Note:

This will automatically open the url in the default browser.

Details

There are two ways to pass argument values to the server:

  • Interactive Path
  • Command Line Path
Interactive Path

To run the server, type the following command in the shell:

crustful

It will ask two questions

  • The Number of Records in the database
  • The Port Number to run the server on

Note:

Both options have default values which would be accepted if you press the Return key

Command Path

crustful server can accepts arguments via the command line and these values become the default values for the Interactive path.

By typing the following command you can display the help for the available options:

crustful -h

Each option has a short form and a long form. Above code was an example of short form. Following is an example of long form e.g.

crustful --help

For the Number of records -r or --records switch is used. We can call the following command for 100 records in the database:

crustful -r 100

This will set the default value for the Number of records question which you can accept by hitting the return key.

For the Number of records -p or --port switch is used. We can call the following command for set the server port to 4000:

crustful -p 4000

This will set the default value for the port number question which you can accept by hitting the return key.

Testing the Server

Database

If you want to access your database db.json on the storage drive it will be located in the global folder.

You can find the global folder by:

npm config get prefix

However, AFAIK, on Windows:

%APPDATA%\npm\node_modules\crustful-server\libs

i.e in user\app_data\roaming\npm\node_modules\crustful-server\libs folder.

On other OS:

/usr/local/lib/node_modules/crustful-server/libs

Tools Suggested

  • Browser like Chrome
  • Browser Plugin/Extension/Addon/Module/Package/whatever to beautify JSON in the browser.
  • Postman Or Insomnia
  • Curl
  • Whatever gimmick , gizmo, gadget or doodah is needed to pull the REST strings....

In the Chrome browser type the following url to get all the records:

http://localhost:3000/emps/

Note: I am using the default port 3000.

empno treated as the id of each record

Say there is an employee number 7754 in the records , so you can get the individual employee by:

http://localhost:3000/emps/7754

This is how far the browser would take you. Now you need the nunchucks.

Postman to the Rescue.

For the sake of convenience, I am sharing my Postman Collection in v1 and v2. Use any one you like and import in Postman to run it.

Check each call's

  • Method
  • URL
  • Headers
  • Body

You can also make curl calls to the server.

Just swing your nunchucks.

Built With

NPM Dependencies

Versioning

  • 1.0.0

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Disclaimer

All the Images are property of Github and used for fun.