Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

opentable/hapi-domainculture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

hapi-domainculture

Domain Culture for Hapi.js

WHY?

We need to be able to support multi domain and languages

How?

{
  register: require('hapi-domainculture'),
  options: {
    white_list: {
      com: {
        cultures: ['en-US', 'fr-CA'],
        default: 'en-US'
      },
      commx: {
        cultures: ['es-MX', 'en-US'],
        default: 'es-MX'
       }
    }, // white_list is required
    query_params: {
      culture: 'culturequery', // defaults to "culture"
      domain: 'domainquery', // defaults to "domain"
      ignore: true // If ignore is true, no queryparams will be checked
    },
    headers: {
      domain: 'domain', // optional, defaults to "domain"
      culture: 'culture' // optional, defaults to "Accept-Language"
    },
    default: 'com' // Default domain to use. required.
  }
}

Checkout the test directory for more examples

About

parse query params OR header for fetching the domain and culture

Resources

License

Stars

Watchers

Forks

Packages

No packages published