Skip to content

Commit

Permalink
Add invalidate endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron committed Apr 30, 2019
1 parent 4c52153 commit 56792b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ class Server {
res.end('</body></html>');
});

app.get('/invalidate', (_req, res) => {
this.invalidate();
res.end();
});

let contentBase;

if (options.contentBase !== undefined) {
Expand Down
4 changes: 4 additions & 0 deletions test/Routes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ describe('Routes', () => {
.expect(200, done);
});

it('GET request to invalidate endpoint', (done) => {
req.get('/invalidate').expect(200, done);
});

it('GET request to live bundle', (done) => {
req
.get('/__webpack_dev_server__/live.bundle.js')
Expand Down

0 comments on commit 56792b7

Please sign in to comment.