How to use the @hapi/accept.languages function in @hapi/accept

To help you get started, we’ve selected a few @hapi/accept examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reworkjs / reworkjs / src / framework / server / setup-http-server / serve-react-route.js View on Github external
export default async function serveReactRoute(req: $Request, res: $Response, next: NextFunction): Promise {

  try {
    const serverHooks = ServerHooks.map(hookModule => {
      const HookClass = getDefault(hookModule);

      return new HookClass();
    });

    try {
      const acceptedLanguages = Object.freeze(accept.languages(req.header('Accept-Language')));
      const loadableResources = new Map();
      const persistentValues = new Map();

      let component = (
        
          
            {/* custom prop injected by universal-cookies */}
            {/* $FlowFixMe */}
            
              
                {rootRoute}
              
            
          
        
      );

@hapi/accept

HTTP Accept-* headers parsing

BSD-3-Clause
Latest version published 1 year ago

Package Health Score

74 / 100
Full package analysis