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

aircode-adapter

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aircode-adapter

Run express and koa apps in AirCode.

  • 0.3.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

AirCode Adapter

Run express and koa apps in AirCode.

Usage

💡 To use this extension, we recommand you to set EXPERIMENTAL_ROUTE=1 to enable router first.

Setup dependencies

Run Express

// test-express.js
const express = require('express');
const app = express();
const { runExpress } = require('aircode-adapter');

const router = express.Router();

router.post('/', function (req, res) {
  res.send({res: 'hello'});
});

app.use('/test-express', router);

module.exports = runExpress(app);

Run Koa

// test-koa.js
const Koa = require('koa')
const { runKoa } = require('aircode-adapter');
const Router = require('@koa/router');

const app = new Koa();
const router = new Router({
  prefix: '/test-koa'
});

router.all('/users/:id', (ctx, next) => {
  // ctx.router available
  ctx.body = {
    params : ctx.params,
    url: ctx.url,
    router: ctx.router,
  };
});

app
  .use(router.routes())
  .use(router.allowedMethods());

module.exports = runKoa(app);

FAQs

Package last updated on 15 Aug 2023

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