Skip to content

Commit

Permalink
Merge pull request #812 from Financial-Times/remove-about-json
Browse files Browse the repository at this point in the history
Breaking: remove the `/__about` endpoint
  • Loading branch information
rowanmanning authored Feb 26, 2024
2 parents ca41831 + 0e70849 commit 5a2cc03
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ As next-metrics must be a singleton to ensure reliable reporting, it is exported
- `fetch` is added as a global using [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch)
- Instrumentation of system and http (incoming and outgoing) performance using [Next Metrics](https://github.com/Financial-Times/next-metrics)
- Anti-search engine `GET /robots.txt` (possibly might need to change in the future)
- Exposes various bits of metadata about the app (e.g. name, version, env, isProduction) to templates (via `res.locals`) and the outside world (via `{appname}/__about.json`)



Expand Down
8 changes: 0 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ const getAppContainer = (options) => {
instrumentListen.addMetrics(serviceMetrics.init());
}

app.get(
'/__about',
/** @type {Callback} */ (req, res) => {
res.set({ 'Cache-Control': 'no-cache' });
res.sendFile(meta.directory + '/public/__about.json');
}
);

if (options.withBackendAuthentication) {
backendAuthentication(app);
}
Expand Down
4 changes: 0 additions & 4 deletions test/app/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ describe('simple app', function () {
request(app).get('/robots.txt').expect(200, done);
});

it('should have an about json', function (done) {
request(app).get('/__about').expect(200, done);
});

describe('backend access', function () {
before(function () {
process.env.NODE_ENV = 'production';
Expand Down
2 changes: 1 addition & 1 deletion test/app/backend-auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('simple app', function () {
});

it('should allow double-underscorey routes through without backend access key', function (done) {
request(app).get('/__about').expect(200, done);
request(app).get('/__health').expect(200, done);
});

it('should accept any request with backend access key', function (done) {
Expand Down

0 comments on commit 5a2cc03

Please sign in to comment.