Skip to content

Commit 94b5e37

Browse files
committed
Revert "add next to template, fixes #1593"
This reverts commit e03ddec.
1 parent fea5eef commit 94b5e37

File tree

3 files changed

+1
-25
lines changed

3 files changed

+1
-25
lines changed

packages/cli/src/routeGeneration/templates/express.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export function RegisterRoutes(app: Router) {
108108
validatedArgs,
109109
successStatus: {{successStatus}},
110110
});
111-
next();
112111
} catch (err) {
113112
return next(err);
114113
}

tests/fixtures/express/server.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,7 @@ app.use((req: any, res: any, next: any) => {
3636
req.stringValue = 'fancyStringForContext';
3737
next();
3838
});
39-
let postRouteMiddlwareCalled = false;
4039
RegisterRoutes(app);
41-
app.get('/reset-post-route-middleware-status', (req, res, next) => {
42-
postRouteMiddlwareCalled = false;
43-
res.json({ postRouteMiddlwareCalled }).send();
44-
next();
45-
});
46-
app.get('/post-route-middleware-status', (req, res, next) => {
47-
res.json({ postRouteMiddlwareCalled }).send();
48-
next();
49-
});
50-
app.use((req, res, next) => {
51-
postRouteMiddlwareCalled = true;
52-
next();
53-
});
5440

5541
// It's important that this come after the main routes are registered
5642
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {

tests/integration/express-server.spec.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,13 @@ import {
2424
const basePath = '/v1';
2525

2626
describe('Express Server', () => {
27-
it('can reset the post route middleware status', () => {
28-
return verifyGetRequest('/reset-post-route-middleware-status', (_err, res) => {
29-
expect(res.body.postRouteMiddlwareCalled).to.eq(false);
30-
});
31-
});
3227
it('can handle get request to root controller`s path', () => {
3328
return verifyGetRequest(basePath + '/', (_err, res) => {
3429
const model = res.body as TestModel;
3530
expect(model.id).to.equal(1);
3631
});
3732
});
38-
it('can verify that post request middleware was called', () => {
39-
return verifyGetRequest('/post-route-middleware-status', (_err, res) => {
40-
expect(res.body.postRouteMiddlwareCalled).to.eq(true);
41-
});
42-
});
33+
4334
it('can handle get request to root controller`s method path', () => {
4435
return verifyGetRequest(basePath + '/rootControllerMethodWithPath', (_err, res) => {
4536
const model = res.body as TestModel;

0 commit comments

Comments
 (0)