-
Notifications
You must be signed in to change notification settings - Fork 9
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
Panic on request #4
Comments
Hi @saeugetier , let's try to figure this one out. My guess is that you have uploaded routes/hello.get.lc which defaults to hello.get.lc as filename (NodeMCU has a key/value file-system, filenames can have slashes). a simple
should do the trick. Of course, it might also be a bug but I just want to be sure. |
auth_api_key.lc : 512 bytes |
[Edit] |
I think the bug is in file askme.post.lua
I seems that the code crashes if route is nil |
Both should work from my previous tests. |
Dear @saeugetier ,
Thanks for helping with your issue, I hope you will like the new version. N.B: There is a small API change when starting a server espress:createserver(port)
espress:use("plugin1.lc")
-- ... Write the following -- The server creation becomes lazy
espress:createserver()
espress:use("plugin1.lc")
-- ...
espress:listen(port) |
Thank you for the fast fix. I will try this version and report back. |
I tried the simple-api demo as described. The api-key is turned of.
local espress = require 'espress'
local port = 80
local server = espress.createserver(port)
server:use("routes_auto.lc")
The nodemcu crashes with this message:
Request received: GET /api/hello
routes/hello.get.lc
PANIC: unprotected error in call to Lua API (?:0: attempt to call a nil value)
Tested firmware is the newest version from http://nodemcu-build.com/ master build with modules: bit, crypto, file, gpio, net, node, tmr, uart, wifi
The text was updated successfully, but these errors were encountered: