[Karax] await for ajaxget

2020-05-02 Thread jjude
How to await ajaxget (or any ajax methods). I have this code: import sugar, json, karax / [kajax, kdom], asyncjs proc onGetObj(status: int, resp: kstring) = let retVal = parseJson($resp) echo retVal proc getObj(sd: string) {.async} = await aja

Re: Video series: Making a WebSite with Nim

2020-04-20 Thread jjude
Great tutorial series. Thank you for this. Are the code shown in the video somewhere in github?

Re: Nim Forum build error

2020-04-17 Thread jjude
` Verifying dependencies for nimforum@2.0.2 Reading official package list Checking for jester@#d8a03aa Info: Dependency on jester@#d8a03aa already satisfied Verifying dependencies for jester@#d8a03aa Reading official package list Checking for httpbeast@>= 0.2.2 Info: Dependency on httpbeast@>= 0

Re: Nim Forum build error

2020-04-17 Thread jjude
Tried both (verbose & individual command). Same error: No binaries built, did you specify a valid binary name?

Nim Forum build error

2020-04-17 Thread jjude
I used the latest code from github. Issued git submodule update --init --recursive nimble frontend Run I get this error: Error: No binaries built, did you specify a valid binary name?. Nim version: Nim Compiler Version 1.0.6 [MacOSX: amd64] How to go further?

Re: Initializing a page with data from backend in Karax

2020-04-14 Thread jjude
while this works if I have only one object, it doesn't serve the purpose if I have multiple objects in different files - says sites in sites.nim, entries in entries.nim and so on. If I have these global ajaxGet in each of these files, they are all called at the start of the program which is unde

Initializing a page with data from backend in Karax

2020-04-14 Thread jjude
I'm using karax to write a SPA. I'm using routes as mentioned in the readme. There is a signin form which gets a token from the backend api. Then the app has to display list of sites for that token proc createDom(data: RouterData): VNode = let uri = $data.hashPart #

Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C

2020-04-01 Thread jjude
😈 🤦‍♂️ Nice one.

Re: Announcement: The Nim compiler is rewritten in Python with some modules optimized in C

2020-04-01 Thread jjude
All of NIM will be rewritten in Python or only machine learning part? Isn't rewriting all of the language into another language waste of time rather than spending it on improving either the language or the ecosystem?

Re: Styling Karax app

2020-02-26 Thread jjude
@juancarlospaco: I am not looking for css themes. I use tachyons and am happy with it. I want to know how to use these within Karax during development.

Re: Styling Karax app

2020-02-26 Thread jjude
Thanks @Araq. 1. I see that this forum uses Spectre.css. But there is no mention of this css in the codebase itself. How did you (or whoever is the author) did it? I see a mock folder. Is it that you mocked the htmls, generated css and linked it back to the generated html? 2. If the process

Styling Karax app

2020-02-26 Thread jjude
I'm starting with Karax apps. Gone through some of the introductory examples. How do you style these especially with things like Bootstrap or other CSS frameworks?

json confusion

2020-02-18 Thread jjude
I am writing an api sever in Nim. The output is of the form: { code:"tk.01", message: "Token in data field", data:"12345" } Run data field could be a string, single object (say a blog post), or an array (sequence) of object

Is it possible to see sql executed?

2020-02-15 Thread jjude
I'm using Jester to create a web-application. It connects to sqlite using db_sqlite. For debugging purposes is it possible to see sqls executed during development?

Extended routes that return json doesn't compile

2020-02-06 Thread jjude
If I have all code in a single file: import jester, json routes: get "/": var jsonResp = $(%*{"id": 2}) resp Http200, jsonResp Run This works well without any problem. Now if I split this into two files: main.nim import jes

Re: Change server name in Jester

2020-02-06 Thread jjude
As a security measure it is advisable to hide the server name. I don't know who to set it up by hand. I searched through Jester's settings document (and code) but couldn't find one that sets the server name. As an example, Beego (the framework I have used in Go) allows setting the servername us

Change server name in Jester

2020-02-06 Thread jjude
I'm using Jester to write a REST server. Is it possible to change the server name from httpbeast?