Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"nimble install servy" and "import servy" not working #2

Open
ITwrx opened this issue Oct 30, 2020 · 4 comments
Open

"nimble install servy" and "import servy" not working #2

ITwrx opened this issue Oct 30, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ITwrx
Copy link

ITwrx commented Oct 30, 2020

I'm looking forward to trying out servy after reading some of your Nim Days book (thanks for that, btw!), but servy doesn't seem to be in the nim packages list anymore, so the install command doesn't work. I installed with nimble install https://github.com/xmonader/nim-servy.git and that appeared to succeed and servy is now in my ~/.nimble/pkgs/ directory, but import servy is not working in the example code when i tried to test. Attempting to build returns Error: cannot open file: servy. I'm using nim 1.4.0 at the moment, if that's relevant.
Thanks

@ITwrx
Copy link
Author

ITwrx commented Oct 30, 2020

also, when i add servy.nim and wsclient.nim to my project folder and import from there, servy doesn't compile with /home/username/moar-path/ITwrxServy.nim(5, 49) Error: undeclared identifier: 'Future'. I'm not reporting that separately yet, in case it's related to these importing issues.

#ITwrxServy.nim

import servy, wsclient

var router = initRouter()

proc handleHello(req: Request, res: Response) : Future[void] {.async.} =
    res.code = Http200
    res.content = "hello world from handler /hello" & $req

router.addRoute("/hello", handleHello)

let opts = ServerOptions(address:"127.0.0.1", port:9000.Port, debug:true)
var s = initServy(opts, router)
s.run()

the failure to build occurs with 1.4.0 and 1.2.8, btw.

@xmonader
Copy link
Owner

Hi, i just opened a PR to publish servy, and if you get the files in master right now it should be fixed already

also if you have servy.nim in your project dir you should be able to execute the content of
examples/hello.nim, and examples/wsclient.nim. Sorry for the inconvenience

@xmonader xmonader self-assigned this Oct 30, 2020
@xmonader xmonader added the bug Something isn't working label Oct 30, 2020
@ITwrx
Copy link
Author

ITwrx commented Oct 30, 2020

thanks!

i re-installed Servy with nimble install https://github.com/xmonader/nim-servy.git, and then downloaded the files from master, and tried to compile the hello example, but it returned Error: cannot open file: servy. So i'll leave this open for you to close when you see fit, as it seems that still may be an issue.

All that being said, I copied the servy.nim from the src dir to the examples dir, and recompiled, and that worked.

Now, to play with Servy some. :) I like the name, btw.

@mationai
Copy link

Seeing the same bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants