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

hapi-accept-language

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-accept-language

automagically parses the accept-language header

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
4
Weekly downloads
 
Created
Source

#Hapi-accept-language Build Status NPM version Dependencies

Hapi plugin for automagically parsing the accept-language header, and populating request.pre.language.

Uses the accept-language-parser module under the hood

installation:

npm install hapi-accept-language

usage:

var hapi = require("hapi");

var server = new hapi.Server({});

server.connection({ port: 3000 });

server.route([{
  method: 'GET',
  path: '/my-url',
  config: {
    handler: function(request, reply){
      reply(request.pre.language)
    }
  }
}]);

server.register([
  require('hapi-accept-language'),
  ], function(err){
    if(err){
      throw err;
    }

    server.start(function(){
      server.log('server started');
    });
});

Keywords

FAQs

Package last updated on 08 Mar 2016

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