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

ohmyapi

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ohmyapi

Yet another API framework

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

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

Oh my api!

This tiny library helps build simple API in minutes. It provides an abstract layer on top of existing popular web frameworks in Nodejs world such as ExpressJS

Getting started

Install

npm install ohmyapi express validate.js

express is the default web engine validate.js is the default validator

Example

const ohmyapi = require('ohmyapi');

app = ohmyapi(`${__dirname}/routes/api`)
  .engine('express', {
    prefix: '/api'
  })
  .authenticate((args, ctx) => {
    // do authentication here
  })
  .authorize({
    isAdmin(args, ctx) {
      // do authorization here
      return ctx.user && ctx.user.isAdmin;
    }
  })
  .init();

TODO

  • Write better documentation...
  • Support more web frameworks
  • Support more data validation libraries

FAQs

Package last updated on 18 Aug 2017

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