New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sinodetra-you-goto-my-head

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sinodetra-you-goto-my-head

Minimal Sinatra like router for node.js by fapprik... with the added ability to respond with custom headers

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-42.86%
Maintainers
1
Weekly downloads
 
Created
Source

sinodetra-you-goto-my-head

Minimal Sinatra like router for node.js by fapprik... with the added ability to respond with custom headers

Installation

npm install sinodetra-you-goto-my-head

Usage

At first, (install and) require sinodetra-you-goto-my-head within your script and specify your preferred port (8000 in this example).

var app = require('sinodetra-you-goto-my-head')(8000)

You can refer to Sinodetra README for a better idea on usage

Examples

app.get('/', function(request, response) {
	response.plain('Hello world!')
})

app.get('/say/:greeting/to/:person', function(request, response, greeting, person) {
	response.html('<b>' + greeting + '</b>, ' + person + '!')
})

app.get('/([0-9]+)/plus/([0-9]+)', function(request, response, one, two) {
	response.plain((parseInt(one, 10) + parseInt(two, 10)).toString())
})

app.error(function(request, response) {
	response.plain('404')
})

// In order to resolve the CORS error when running the server locally
app.get('/healthcheck', (request, response) => {
  console.log(request)
	response.send(
    {active: true},
    200,
    'application/json',
    {'Access-Control-Allow-Origin': "*", 'Access-Control-Allow-Methods': 'POST, GET, PUT, DELETE'}
  )
})  

Contributors

Keywords

FAQs

Package last updated on 08 Mar 2018

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