Socket
Socket
Sign inDemoInstall

alamid-api

Package Overview
Dependencies
93
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    alamid-api

abstracting http/websockets requests


Version published
Maintainers
1
Install size
16.0 MB
Created

Readme

Source

Abstracting different transports (http/websockets) and libraries to a unite them all.

Usage

var api = require("alamid-api"),

var router = api.router();

//attach your universal routes
router.get("/hello", function(req, res, next) {
    res.end("You can use me via ws and http!");
});

var app = express(),
    server = http.createServer(app),
    io = socketIO.listen(server);

//with connect/express app
alamidRequest.use(require("alamid-api/plugins/connect"), { app: app });

//with http.Server
alamidRequest.use(require("alamid-api/plugins/http"), { server: server });

//with socket.io
alamidRequest.use(require("alamid-api/plugins/socket.io"), { io: io });

Plugins

Enhanced Response


api.use(require("alamid-api/plugins/enhancedResponse"));

API

  • res.send(statusCode?, response)
  • res.success(data)
  • res.fail(code)
  • res.error(code)

FAQs

Last updated on 10 Mar 2014

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