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

@adonisjs/http-server

Package Overview
Dependencies
Maintainers
2
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adonisjs/http-server

Extracted copy of AdonisJs HTTP server along with it's router

  • 1.2.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
decreased by-29.67%
Maintainers
2
Weekly downloads
 
Created
Source

Http Server

circleci-image npm-image license-image

Node.js HTTP server with a slick router used by AdonisJs. Think of it as an ExpressJs style server written in Typescript.

Table of contents

Usage

Install the package from npm registry as follows:

npm i @adonisjs/http-server

# yarn
yarn add @adonisjs/http-server

and then use it as follows:

import proxyaddr from 'proxy-addr'
import { createServer } from 'http'
import { Logger } from '@adonisjs/logger/build/standalone'
import { Profiler } from '@adonisjs/profiler/build/standalone'
import { Server } from '@adonisjs/http-server/build/standalone'

const logger = new Logger({ enabled: false, level: 'trace', name: 'adonis' })
const profiler = new Profiler({})
const config = {
  etag: false,
  jsonpCallbackName: 'callback',
  cookie: {},
  subdomainOffset: 2,
  generateRequestId: false,
  secret: Math.random().toFixed(36).substring(2, 38),
  trustProxy: proxyaddr.compile('loopback'),
  allowMethodSpoofing: false,
}

const server = new Server({} as any, logger, profiler, config)
server.optimize()

createServer(server.handle.bind(server)).listen(3000)

Router

AdonisJs has one of the most advanced and fast router. It has support for Route groups, Resourceful resources and many more.

router.group(() => {
  router.get('/', async () => {
  })
}).prefix('v1')

Profiler action labels

Following is the list of actions profiled during an HTTP request

  • http:request
  • http:before:hooks
  • http:route:match
  • http:route:stack
  • http:after:hooks
  • http:route:handler

We recommend you to check the API docs to get a complete reference of all the classes.

API

Following are the autogenerated files via Typedoc

Maintainers

Harminder virk

Keywords

FAQs

Package last updated on 20 Sep 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