Open jjude opened 4 years ago
Did you try to access localhost:5000/api/v1
? In my case it worked with the extra /
at the end only. So if you do localhost:5000/api/v1/
you might get that response
Not really sure we can do much here in jester, it's more of a Nim limitation. You can export json
in api.nim to work around it.
What is more frustrating is that the error reported under Nim1.6.2 may no longer be "error: unknown identifier:", but become a more puzzling "error: unhandled exception: index 12 not in 0.. 11 [indexdefect]". When I first encountered this problem, I even began to doubt the reliability of Nim language. Fortunately, I finally found that the problem lies in import through compiling Nim1.4.9 myself. Now I think the only feasible way is to use include instead of import for extended routes module.
In addition, the following questions may be relevant: https://github.com/dom96/jester/issues/178
OS: Mac
Nimble:
If I have all code in a single file:
It compiles and gets the expected output.
Now if I split this into two files:
main.nim
and
api.nim
( in the same folder)Then it doesn't compile. The errors are: