I have been writing slingservlets to do backend functions, and testing with postman.
However, sometimes I need to create a test HTML page, e.g. with a form to upload a file.
In aem its easy to create pages, but you can only add text/images, you cant edit the HTML.
Looking in the project, I cant see an obvious way to create a HTML page. Any suggestions where to look?
There are a lot of tutorials on creating pages from templates, but these dont seem to include editing HTML. Presumably I need to write some code to create a new template with my HTML, then create a page to use that template. I cant see how to create a template where I can defined the HTML the template uses?
Or do I instead have to create a new component with a simple HTML form in it, then drop that into an existing page template?
For your use case, custom HTML for local development environment & test purposes, I would suggest you create a simple component. Next, ensure your component is within a component group, so you can drag and drop the component on the page.
Once when you have created your simple AEM component, you can go ahead and edit your existing page. Drag the component into the page. If your available component is not listed in the components sidebar, then you might want to double-check if your template policies (editable template), or allowed components (static template).
If you want to write HTML into your webpage the quick and dirty way, then you can also make changes directly into your basepage.html, where HTML will be visible on your entire local development environment.