Closed thescientist13 closed 3 months ago
(breaking) APIs in the pages/ directory? I think so, to not "leak" as much greenwood to the user, and to avoid routing conflicts
So one thing that would be good is to support both "pages" and APIs within this joined directory, e.g
src/
pages/
components/
greeting.js
api/
login.js (will be an actual API - /api/login - server rendered)
login-client.html (will just be an HTML page - /api/login-client/ - static rendered)
docs/
login-client.html (will just be an HTML page)
index.html
about.js
if (body.indexOf('<content-outlet></content-outlet>') > 0) {
body = body.replace('<content-outlet></content-outlet>', `
<h1>Welcome to Greenwood!</h1>
`);
}
From our chat today, I think this indeed better placed into the path of our init package / starter kits and templates.
Follow up issue for mixed content in the API pages directory - https://github.com/ProjectEvergreen/greenwood/issues/1246
Related Issue
resolves #955 and fixes #1044 and #988
Summary of Changes
TODO
static pagesdynamic pages + .ts exampleAPIsgetLayout
Thoughts / Questions
<slot>
instead of<content-outlet>
? Or maybe not? - Won't DobundleSsrPages
should probably happen in the pool too? Not sure, it worked previously without this particular detail... 🤷♂️ - https://github.com/ProjectEvergreen/greenwood/issues/1249Nice to have / standalone issues
<!-- greenwood-ssr-start -->
implementation - https://github.com/ProjectEvergreen/greenwood/issues/1249preRenderCompilationWorker
could we consolidate into ONE SSR call? (insteadserve
+ execute-route-module) - https://github.com/ProjectEvergreen/greenwood/issues/1249/
) - #1176