Skip to content

Commit

Permalink
feat(app): output also for post requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ernscht committed Feb 12, 2024
1 parent cf90b3f commit 3f5b2d3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getUser(req, res, next) {
}

module.exports = (app) => {
app.route('/').get(getUser);
app.route('/').all(getUser);
};
```

Expand Down
6 changes: 3 additions & 3 deletions packages/nitro-app/app/core/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ function getView(req, res, next) {
next();
}
}
router.get('/', getView);
router.get('/:view', getView);
router.all('/', getView);
router.all('/:view', getView);
// subpathes will be routed to the main view if it exists
router.get('/:view/*', getView);
router.all('/:view/*', getView);

/**
* everything else gets a 404
Expand Down
2 changes: 1 addition & 1 deletion packages/project-nitro-twig/project/viewData/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getUser(req, res, next) {
}

module.exports = (app) => {
app.route('/').get(getUser);
app.route('/').all(getUser);
};
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getUser(req, res, next) {
}

module.exports = (app) => {
app.route('/').get(getUser);
app.route('/').all(getUser);
};
```

Expand Down
2 changes: 1 addition & 1 deletion packages/project-nitro/project/viewData/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getUser(req, res, next) {
}

module.exports = (app) => {
app.route('/').get(getUser);
app.route('/').all(getUser);
};
```

Expand Down
4 changes: 2 additions & 2 deletions packages/project-nitro/project/viewData/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ function getUser(req, res, next) {
}

exports = module.exports = function (app) {
app.route('*') // all routes
.get(getUser);
// all routes
app.route('*').all(getUser);
};
2 changes: 1 addition & 1 deletion packages/project-prod/project/viewData/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getUser(req, res, next) {
}

module.exports = (app) => {
app.route('/').get(getUser);
app.route('/').all(getUser);
};
```

Expand Down

0 comments on commit 3f5b2d3

Please sign in to comment.