Skip to content

Commit da8f440

Browse files
authored
fix: disable minimal mode for API routes (#1727)
1 parent 98aacdb commit da8f440

File tree

3 files changed

+37
-42
lines changed

3 files changed

+37
-42
lines changed

cypress/integration/default/api.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
describe('API routes', () => {
2+
it('serves custom headers on an api route', () => {
3+
cy.request('/api/hello').then((response) => {
4+
expect(response.headers).to.have.property('x-custom-api-header', 'my custom api header value')
5+
})
6+
})
7+
})
8+
19
describe('Extended API routes', () => {
210
it('returns HTTP 202 Accepted for background route', () => {
311
cy.request('/api/hello-background').then((response) => {

package-lock.json

Lines changed: 29 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/runtime/src/templates/getApiHandler.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ const makeHandler = (conf: NextConfig, app, pageRoot, page) => {
6666

6767
const NextServer: NextServerType = getNextServer()
6868
const nextServer = new NextServer({
69-
// We know we're just an API route, so can enable minimal mode
70-
minimalMode: true,
7169
conf,
7270
dir,
7371
customServer: false,

0 commit comments

Comments
 (0)