Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nowapi-cli

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nowapi-cli

NowAPI CLI

  • 1.11.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

NowAPI - When you need an API Now

CI npm version

Logo

Instantaneously create static HTTPS REST-like API endpoints.

When you don't want to go through all the hassle of setting up a REST API backend, NowAPI is the tool for you.

Use cases:

  • Tutorials
  • Simple static backend API endpoints
  • Learning REST APIs
  • Debugging client software

NowAPI has just been released and therefore subject to change. Your feedback is very welcome, please open an issue.

Overview

  1. Create a new virtual host:

    nowapi host new
    

    Output:

    ✔ Host created: amethyst-ptarmigan-98
    
  2. Add endpoints:

    For example, the IMDB movie top 3 as a JSON list of IMDB identifiers:

    nowapi endpoint set amethyst-ptarmigan-98 movies/top3 -b '["tt0111161", "tt0068646", "tt0468569"]'
    

    Add endpoints for details on each movie:

    nowapi endpoint set amethyst-ptarmigan-98 movie/tt0111161 -b '{"title": "The Shawshank Redemption"}'
    nowapi endpoint set amethyst-ptarmigan-98 movie/tt0068646 -b '{"title": "The Godfather"}'
    nowapi endpoint set amethyst-ptarmigan-98 movie/tt0468569 -b '{"title": "The Dark Night"}'
    
  3. List endpoints

    nowapi endpoint ls amethyst-ptarmigan-98
    

    Output:

    ✔ Loading endpoints
    Endpoints on host amethyst-ptarmigan-98:
    - movies/top3
      https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movies/top3
    - movie/tt0111161
      https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movie/tt0111161
    - movie/tt0068646
      https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movie/tt0068646
    - movie/tt0468569
      https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movie/tt0468569
    
  4. Use endpoints

    List movie top-3:

    curl https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movies/top3
    

    Output:

    ["tt0111161", "tt0068646", "tt0468569"]
    

    Get movie by identifier:

    curl https://nowapi.vercel.app/api/hosts/amethyst-ptarmigan-98/movie/tt0068646
    

    Output:

    {"title": "The Godfather"}
    

Installation

Homebrew

For macOS there is a Homebrew tap available:

brew tap robvanderleek/nowapi
brew install nowapi

NPX

Using npx, installation is not necessary. You can run NowAPI on a system with NodeJS 18 or higher from the command-line as follows:

npx nowapi-cli@latest -V

this should display the version number of the latest release.

Using npm NowAPI can be installed globally as follows:

npm install -g nowapi-cli

Platform binaries

Binaries for different platforms (Linux, Windows) are available on the latest release page.

Usage

Available commands and options can be listed by running the tool:

nowapi

It's necessary that you authorize NowAPI to interact with the NowAPI backend. This can be done by logging in as described below.

Login

nowapi login

Cope the code and open the web page.

Logout

nowapi logout

Hosts

Create a new virtual host

nowapi host new

Lists your virtual hosts

nowapi host ls

Delete new virtual host

nowapi host rm amethyst-ptarmigan-98

Endpoints

Create a new endpoint

nowapi endpoint set amethyst-ptarmigan-98 movie/tt0111161 -b '{"title": "The Shawshank Redemption"}'

Lists endpoints on a virtual host:

nowapi endpoint ls amethyst-ptarmigan-98

Delete endpoint on a virtual host:

nowapi endpoint rm amethyst-ptarmigan-98 movie/tt0111161

Feedback, suggestions and bug reports

Please create an issue here: https://github.com/robvanderleek/nowapi/issues

Contributing

If you have suggestions for how create-issue-branch could be improved, or want to report a bug, open an issue! All and any contributions are appreciated.

License

ISC © 2023 Rob van der Leek robvanderleek@gmail.com (https://twitter.com/robvanderleek)

FAQs

Package last updated on 04 Jul 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc