additions to the generator, only needed to add files under ResourceFiles
(notice how our additions have reduced from original, to datamodel, to client), put in a final section
html without extension, hack so we can view contemporary url routes
gen/server.cue
// Generator definition#Generator: gen.#Generator & {// Define the resource Files ResourceFiles: [...gen.#File] & [// REST handlers, as before// HTML content for _, R in In.Resources { In: { RESOURCE: R } TemplatePath: "resource.html" Filepath: "\(Outdir)/client/\(strings.ToLower(In.RESOURCE.Name))" },// HTML content for _, R in In.Resources { In: { RESOURCE: R } TemplatePath: "resource.js" Filepath: "\(Outdir)/client/\(strings.ToLower(In.RESOURCE.Name)).js" }, ]}
Initial HTML / JS
Since we broke down index.html into a number of partials,
we can reuse them here and end up with a template for resource html
which is very close to our index page.