Skip to content

Commit 56792b7

Browse files
committed
Add invalidate endpoint
1 parent 4c52153 commit 56792b7

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/Server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ class Server {
299299
res.end('</body></html>');
300300
});
301301

302+
app.get('/invalidate', (_req, res) => {
303+
this.invalidate();
304+
res.end();
305+
});
306+
302307
let contentBase;
303308

304309
if (options.contentBase !== undefined) {

test/Routes.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ describe('Routes', () => {
3333
.expect(200, done);
3434
});
3535

36+
it('GET request to invalidate endpoint', (done) => {
37+
req.get('/invalidate').expect(200, done);
38+
});
39+
3640
it('GET request to live bundle', (done) => {
3741
req
3842
.get('/__webpack_dev_server__/live.bundle.js')

0 commit comments

Comments
 (0)