DEV Community

Discussion on: Creating a JSON API with Athena & Granite

 
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.