get-convex / get-convex/static-hosting

Support MPAs / prerendering

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
33
Forks
6
PR merge metrics
No merged PRs in 30d

Description

I setup prerendering but convex keeps serving the same index.html file for EVERY route, even with spa fallback turned off.

What I mean by this is my `dist/` looks something like:

```
/index.html
/foo/index.html
/bar/index.html
```

This code:
```
registerStaticRoutes(http, components.selfHosting, {
pathPrefix: "/",
spaFallback: false,
});
registerStaticRoutes(http, components.selfHosting, {
pathPrefix: "/foo",
spaFallback: false,
});
registerStaticRoutes(http, components.selfHosting, {
pathPrefix: "/bar",
spaFallback: false,
});
```

has the following behavior:
```
/ -> renders /index.html
/foo -> renders /index.html
/bar -> renders /index.html
/foo/index.html -> 404
/bar/index.html -> 404
```

Whereas I would like the behavior:
```
/ -> renders /index.html
/foo -> renders /foo/index.html
/bar -> renders /bar/index.html
```

Made a prototype for a new flag here, but it's not tested:

https://github.com/xavierchanth/static-hosting/tree/patch-1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.