-
-
Notifications
You must be signed in to change notification settings - Fork 20
SPA
Ethosa edited this page Jun 6, 2023
·
5 revisions
Basic Code of main.nim
import happyx
appRoutes("app"): # "app" is id of application root element in HTML
"/":
"Hello, world!"
Basic Code of main.html
...
<body>
<div id="app"></div>
<script src="main.js"></script>
</body>
...
Compilation
nim js main
Project structure:
project/
├─ src/
│ ├─ public/
│ │ ├─ hello.png
│ ├─ main.nim
├─ README.md
main.nim
or any other nim file
import happyx
appRoutes("app"):
"/":
tImg(src = "public/hello.png")