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

flyn

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flyn

Flyn is a multi framework package that makes easier to create routes for controllers.

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
Maintainers
1
Weekly downloads
 
Created
Source

Flyn

Flyn is a multi framework package that makes easier to create routes for controllers.

Install

NPM

  • Use: require('flyn')
  • Install: npm install --save flyn

YARN

  • Use: require('flyn')
  • Install: yarn add flyn

Usage

Example

const app = require('express')()

flyn({
  path: './routes', // default
  logger: true, // default
  prefix: '' // default
})(app)

app.listen(process.env.PORT, () => {
  console.log(
    'Server running on', 
    process.env.PORT
  )
})

Endpoint file example

// ./routes/GET.status.js

/*
  FILE PATH === './routes/GET.status.js'
  METHOD === 'GET'
  URL === '/status'
*/

module.exports = app => (req, res) => {

  return res.send({
    success: 1
  })
}

Another endpoint file example

// ./routes/entities/POST.user.js

/*
  FILE PATH === './routes/entities/POST.user.js'
  METHOD === 'POST'
  URL === '/entities/user'
*/

module.exports = app => (req, res) => {

  console.log('User created with success')

  return res.send({
    success: 1
  })
}

Compatibility

Now

  • Express
  • Fastify
  • Hapi

Soon

  • Koa
  • NestJs

License

Licensed under permissive MIT license

Keywords

FAQs

Package last updated on 03 Jul 2019

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