I set up a project using NodeJs and have proceeded with designs and API’s etc in that project.
I have just found out that it may have to be a non NodeJs and instead be HTML based.
I know if I simply change the project settings then everything could be lost.
I have experimented with copying the code from each page and placing into a test HTML project page.
Obviously some issues as there is some code relating to the NodeJS set up / .EJS files etc.
And I attempt to save Wappler insists the page does not exist even as … @@
I don’t wish to recreate the core of the project again (UI, API, server actions etc).
Anyway is there a fix for this and for the copied code - what code NodeJS / EJS /etc code should I look for - (find and replace / delete), to allow the page to recognised in the HTML format?
Attached are reference to
the present ‘NofeJS’ file - named Node
a file format in HTML that developer colleague set up
Thanks @ben - will try tmrw.
Just to clarify process-
should I just switch project settings first
create a new project in the html
Format and then copy in code for the pages
Or ?!
Sorry just not clear how I should proved ,
As may **** it up!
Thanks!!
Hi @UDX I’m getting the impression you’re relatively new to all this.
If not, please forgive me as I will give you some tips that are aimed at a beginner.
These .EJS files are HTML files but with embedded javascript templating. https://ejs.co/
A very simple explanation for this is that it functions exactly the same as a .html file, yet it has some extra benefits. You can insert data from the server before rendering.
This is exactly what wappler is doing to give you the ‘layout’ and ‘content’ page system.
If you make a new layout page you’ll see something like this:
First notice that it starts with <!doctype html> ? This is basically an html file.
Secondly, you notice the <%- await include(content, locals); %> ? This is EJS.
When the user goes to the page, the server will have to render this page for the user. While rendering it combines the layout page with the content page.
It puts ALL the code you can find in the content-page.ejs into the place of <%- await include(content, locals); %> on the layout page.
I hope this helps with giving you a better understanding of what EJS does + what wappler is doing for you by default when you have a node project.
Do you NOT want a node server?
If that’s true: you need to make a new .HTML file and copy the code of the layout page + the code of the content page into that 1 HTML file.
If you want to keep your node server but for some reason don’t want .ejs files: then I don’t see the point yet of getting rid of .ejs files.
Keep in mind that if you do the site as .html files. You can’t use the server connect actions, etc. That requires server side formats such as Node, php or asp.