Files
shields/services/deprecated-service.js
Paul Melnikow 02ec19fd22 BaseService terminology: Rename url to route (#2278)
The term “url” is overloaded in services, to refer to the Shields route and also the API URL. Calling the Shields URL a “route” is on the whole more descriptive, and makes it clearer and more obvious which one of these we’re talking about. It’s a small thing, though seems like an improvement.

We have a few functions called `buildUrl`. I’ve renamed them to `buildRoute` when they refer to routes, and left them as `buildUrl` when they refer to API URLs.

I included a minor style tweak and some formatting cleanup in `TUTORIAL.md`.
2018-11-09 15:11:03 -05:00

32 lines
575 B
JavaScript

'use strict'
const BaseService = require('./base')
const { Deprecated } = require('./errors')
// Only `url` is required.
function deprecatedService({ url, label, category, examples = [] }) {
return class DeprecatedService extends BaseService {
static get category() {
return category
}
static get route() {
return url
}
static get defaultBadgeData() {
return { label }
}
static get examples() {
return examples
}
async handle() {
throw new Deprecated()
}
}
}
module.exports = deprecatedService