Skip to content
Ethosa edited this page May 6, 2023 · 5 revisions

Single Page Application

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
Clone this wiki locally