Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch up to latest versions of core infrastructure. Also polish up certain bits of ES5 code to better use ES6+ options.
19 lines (15 sloc)
725 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const rest = require('rest'); | |
const defaultRequest = require('rest/interceptor/defaultRequest'); | |
const mime = require('rest/interceptor/mime'); | |
const uriTemplateInterceptor = require('./api/uriTemplateInterceptor'); | |
const errorCode = require('rest/interceptor/errorCode'); | |
const baseRegistry = require('rest/mime/registry'); | |
const registry = baseRegistry.child(); | |
registry.register('text/uri-list', require('./api/uriListConverter')); | |
registry.register('application/hal+json', require('rest/mime/type/application/hal')); | |
module.exports = rest | |
.wrap(mime, { registry: registry }) | |
.wrap(uriTemplateInterceptor) | |
.wrap(errorCode) | |
.wrap(defaultRequest, { headers: { 'Accept': 'application/hal+json' }}); |