sinasamavati / leptus

The Erlang REST framework
https://sinasamavati.com/leptus
MIT License
346 stars 50 forks source link

issue at start #57

Closed dubrovine closed 7 years ago

dubrovine commented 7 years ago

Hello. I'm kinda new to erlang and trying to make simple rest api so i found the Leptus :)

i have already compiled the app via rebar3 and now I getting the errors

1> leptus:startlistener(http, [{'', [{hello, undefined_state}]}]). ** exception error: undefined function hello:routes/0 in function leptus_router:'-handle_routes/2-fun-0-'/2 (c:/restapi/_build/default/lib/leptus/src/leptus_router.erl, line 94) in call from lists:foldl/3 (lists.erl, line 1263) in call from leptus_router:handle_routes/2 (c:/restapi/_build/default/lib/leptus/src/leptus_router.erl, line 96) in call from leptus:start_listener/4 (c:/restapi/_build/default/lib/leptus/src/leptus.erl, line 96)

could you please tell me where I turned the wrong way? thx in advance

sinasamavati commented 7 years ago

Hello,

Maybe you didn't add this to your module:

-compile({parse_transform, leptus_pt}).
dubrovine commented 7 years ago

added. I am using your Quick example for testing

dubrovine commented 7 years ago

sorry, figured out. I forgot to change 'hello' to my currest app name.

thx :)