Socket
Socket
Sign inDemoInstall

supershit

Package Overview
Dependencies
18
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    supershit

I peace of awsomeshit which improves your live.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Supershit

Lightweight search-engine friendly single-page web framework

Requirements

NodeJS >= 8

Installation

npm i supershit -g

How to use

REST API

Lets create a simple REST API in a few steps.

const api = supershit.api('/api')

api.route('/hello', {
  get() {
    return { message: 'Hello World!' }
  }
})

You'll find this example in examples/simple-api.js folder. Start the example by using the command node examples/simple-api.js and fire a curl to the API.

curl -X GET -H "accept: application/json" http://localhost:7448/api/hello

# Response
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Content-Type: application/json; charset=utf-8
< Content-Length: 26
{"message":"Hello World!"}

Read more about the api() method at REST API page

Start a server

The default port is 7448. Supershit starts a webserver when it's required. Use the start command supershit start to start the app in clustermode or for development the dev command supershit dev, it reloads the app everytime when a source file changes.

Refer to CLI page to get a list of all supported commands.

Config

Supershit reads config from config/${process.env.NODE_ENV}.json. A config file can be either a .json, .cson or .yaml file.

// load config from config files
const config = supershit.config()

Read more about config at the Config page.

Logging

const log = supershit.logger()
log.info('App started successful,', {
  port: 7448
})

log.debug('Process id:,', process.pid)

Read more about logging at the Logging page.

Keywords

FAQs

Last updated on 02 Sep 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc