DEV Community

Discussion on: Creating a JSON API with Athena & Granite

 
blacksmoke16 profile image
Blacksmoke16 • Edited

Ahhh I figured it out. Apparently shards update doesn't actually update the directory in ./lib, thus my version locally was still using the older Athena version. I'll push a fix right now.

Thread Thread
 
phangs profile image
phangs

that's great! thank you very much. I will check in a bit and clone the project again.

I really appreciate your help

Thread Thread
 
phangs profile image
phangs

Code is now running, just noticed:

  1. After cloning, user must create the logs/development.log directory and file. The code will look for it and will not compile it does not exist.

  2. Was not yet able to find the problem when send post request to localhost:8888/user, error in logs is:
    [2019-11-25T05:37:51.194843000Z] main.CRITICAL: Unhandled exception: relation "users" does not exist in Blog::Controllers::UserController at src/controllers/user_controller.cr:6:107 {"cause":null,"cause_class":"Nil"}

I will try later to figure this out

Thread Thread
 
blacksmoke16 profile image
Blacksmoke16

Thanks, I pushed a fix for #1. The other error would be because Granite can't find a table called users in the database you're connected to. Be sure you ran the few SQL scripts I've included if you're using PG. Otherwise, be sure you create tables in your DB of choice.