Update preview endpoint to be prefixed with /app to not require an updated proxy config
This commit is contained in:
parent
4ba16eaf0a
commit
8925cdf83e
|
@ -65,10 +65,6 @@ http {
|
|||
proxy_pass http://{{ address }}:4001;
|
||||
}
|
||||
|
||||
location /preview {
|
||||
proxy_pass http://{{ address }}:4001;
|
||||
}
|
||||
|
||||
location /builder {
|
||||
proxy_pass http://{{ address }}:3000;
|
||||
rewrite ^/builder(.*)$ /builder/$1 break;
|
||||
|
|
|
@ -88,10 +88,6 @@ http {
|
|||
proxy_pass http://$apps:4002;
|
||||
}
|
||||
|
||||
location /preview {
|
||||
proxy_pass http://$apps:4002;
|
||||
}
|
||||
|
||||
location = / {
|
||||
proxy_pass http://$apps:4002;
|
||||
}
|
||||
|
|
|
@ -290,7 +290,7 @@
|
|||
<iframe
|
||||
title="componentPreview"
|
||||
bind:this={iframe}
|
||||
src="/preview"
|
||||
src="/app/preview"
|
||||
class:hidden={loading || error}
|
||||
class:tablet={$store.previewDevice === "tablet"}
|
||||
class:mobile={$store.previewDevice === "mobile"}
|
||||
|
|
|
@ -56,7 +56,7 @@ router
|
|||
authorized(PermissionTypes.TABLE, PermissionLevels.WRITE),
|
||||
controller.deleteObjects
|
||||
)
|
||||
.get("/preview", authorized(BUILDER), controller.serveBuilderPreview)
|
||||
.get("/app/preview", authorized(BUILDER), controller.serveBuilderPreview)
|
||||
.get("/:appId/:path*", controller.serveApp)
|
||||
.get("/app/:appUrl/:path*", controller.serveApp)
|
||||
.post(
|
||||
|
|
|
@ -150,14 +150,14 @@ describe("/static", () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe("/preview", () => {
|
||||
describe("/app/preview", () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
})
|
||||
|
||||
it("should serve the builder preview", async () => {
|
||||
const headers = config.defaultHeaders()
|
||||
const res = await request.get(`/preview`).set(headers).expect(200)
|
||||
const res = await request.get(`/app/preview`).set(headers).expect(200)
|
||||
|
||||
expect(res.body.appId).toBe(config.appId)
|
||||
expect(res.body.builderPreview).toBe(true)
|
||||
|
|
Loading…
Reference in New Issue