-
Notifications
You must be signed in to change notification settings - Fork 12
server: Add handling of / requests for index.html #3853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # packages/realm-server/server.ts # packages/realm-server/tests/server-endpoints-test.ts
Host Test Results 1 files ± 0 1 suites ±0 1h 38m 19s ⏱️ + 9m 22s Results for commit ba64a27. ± Comparison against base commit 90d8c13. This pull request removes 1 and adds 219 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
| await context.dbAdapter.execute( | ||
| `INSERT INTO boxel_index_working (url, file_alias, type, realm_version, realm_url, isolated_html) | ||
| VALUES ('${cardURL}', '${cardURL}', 'instance', 1, '${testRealm2URL.href}', '${isolatedHTML}')`, | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test from the existing implementation of including the isolated template in index.html; when working on this I decided I didn’t like it mutating the database, and changed the setup to write files to the realm that will produce the expected boxel_index entries for inclusion in index.html.
We expect requests ending in
/to behave as they do generally on the web: if…/index.jsonexists, it should be served.This ignores the
hostHomeconcept as things are moving in another direction and that’ll become obsolete.With this branch deployed and a card at
https://minicatalog.staging.boxel.build/blog-app/BlogApp/index.json, a request forhttps://minicatalog.staging.boxel.build/blog-app/BlogApp/gets a prerendered isolated response: