Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethosa committed Aug 22, 2023
1 parent 01aea76 commit d580ce1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
16 changes: 16 additions & 0 deletions examples/website/src/docs/happyx_app.nim
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,19 @@ component HappyxApp:
("Nim (SPA)", "nim", nimSpaCalc, cstring"nim_server_ssr", newPlayResult()),
("Python", "python", pythonSsrCalc, cstring"py_server", newPlayResult()),
])

tH3: {translate("Run App ▶")}

if currentLanguage == "Nim (SPA)":
tP:
{translate("If you create Single-page application then you need ")}
tCode: "example.html"
{translate("file:")}

component CodeBlock("html", htmlHelloWorldExample, "html_hello_world")

component CodeBlockGuide(@[
("Nim", "shell", "nim c -r calculator.nim", cstring"nim_ssr", playCalculatorAppSsr),
("Nim (SPA)", "shell", "nim js calculator.nim\nopen calculator.html#/calc/5/*/5", cstring"nim_ssr", playCalculatorAppSpa),
("Python", "shell", "python calculator.py", cstring"py_hello_world", playCalculatorAppSsr),
])
18 changes: 18 additions & 0 deletions examples/website/src/ui/play_states.nim
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,21 @@ Read docs: https://tailwindcss.com/docs/""", cstring"", cstring"shell", 250),
(cstring"Successfully created client project", cstring"", cstring"shell", 250),
(cstring"", cstring"", cstring"", 10000)
])
playCalculatorAppSpa* = newPlayResult(@[
(cstring"", cstring"""
<div id="calculator_app" class="w-full h-48 bg-white text-black", style="font-family: serif; font-size: 100%;">
25
</div>
""", cstring"", 100),
(cstring"", cstring"", cstring"", 10000)
])
playCalculatorAppSsr* = newPlayResult(@[
(cstring"$ curl -D- http://127.0.0.1:5000/calc/5/*/5", cstring"", cstring"shell", 250),
(cstring"""
HTTP/1.1 200 OK
Content-Type: text/plaintext
25
""", cstring"", cstring"http", 500),
(cstring"", cstring"", cstring"", 10000)
])
2 changes: 1 addition & 1 deletion happyx.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

description = "Macro-oriented asynchronous web-framework written with ♥"
author = "HapticX"
version = "2.2.0"
version = "2.5.1"
license = "MIT"
srcDir = "src"
installExt = @["nim"]
Expand Down
2 changes: 1 addition & 1 deletion src/happyx/core/constants.nim
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const
# Framework version
HpxMajor* = 2
HpxMinor* = 5
HpxPatch* = 0
HpxPatch* = 1
HpxVersion* = $HpxMajor & "." & $HpxMinor & "." & $HpxPatch


Expand Down

0 comments on commit d580ce1

Please sign in to comment.