Avoids crashes in `server.spec.js` accompanied by this cryptic message: ``` Error: listen EADDRINUSE :::1111 at Object._errnoException (util.js:1022:11) at _exceptionWithHostPort (util.js:1044:20) at Camp.setupListenHandle [as _listen2] (net.js:1367:14) at listenInCluster (net.js:1408:12) at doListen (net.js:1517:7) at _combinedTickCallback (internal/process/next_tick.js:141:11) at process._tickDomainCallback (internal/process/next_tick.js:218:9) ``` e.g. https://circleci.com/gh/badges/shields/24094
24 lines
556 B
JavaScript
24 lines
556 B
JavaScript
'use strict'
|
|
|
|
const BaseService = require('./base')
|
|
|
|
// registerFn: ({ camp, cache }) => { camp.route(/.../, cache(...)) }
|
|
class LegacyService extends BaseService {
|
|
static registerLegacyRouteHandler({ camp, cache, githubApiProvider }) {
|
|
throw Error(`registerLegacyRouteHandler() not implemented for ${this.name}`)
|
|
}
|
|
|
|
static register(
|
|
{ camp, handleRequest: cache, githubApiProvider },
|
|
serviceConfig
|
|
) {
|
|
this.registerLegacyRouteHandler({
|
|
camp,
|
|
cache,
|
|
githubApiProvider,
|
|
})
|
|
}
|
|
}
|
|
|
|
module.exports = LegacyService
|