Skip to content

Commit c24a520

Browse files
authored
fix: handle custom publish dir for api routes (#1697)
* fix: handle custom publish dir for api routes * chore: use plugin wrapper in nx * chore: fix nx demo * chore: add e2e test
1 parent 6789f37 commit c24a520

File tree

15 files changed

+533
-405
lines changed

15 files changed

+533
-405
lines changed

cypress/integration/nx/general.spec.ts

+7
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ describe('Default site', () => {
1616
expect(res.headers['content-type']).to.match(/javascript/)
1717
})
1818
})
19+
20+
it('serves API routes', () => {
21+
cy.request('/api/hello').then((res) => {
22+
expect(res.status).to.eq(200)
23+
expect(res.body).to.deep.eq({ body: 'Hello world' })
24+
})
25+
})
1926
})

demos/nx-next-monorepo-demo/libs/.gitkeep

Whitespace-only changes.

demos/nx-next-monorepo-demo/netlify.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff
77
command = "npm run start"
88
targetPort = 4200
99

10+
[[plugins]]
11+
package = "../plugin-wrapper"
12+
1013
[[plugins]]
1114
package = "@netlify/plugin-nextjs"
1215

1316
# This is a fake plugin, that makes it run npm install
1417
[[plugins]]
1518
package = "@netlify/plugin-local-install-core"
16-
17-
[[plugins]]
18-
package = "../plugin-wrapper"

0 commit comments

Comments
 (0)