waiyaki / postgres-express-node-tutorial

Repository hosting code for the "Getting Started With NodeJS, Express and Postgres Using Sequelize" blogpost.
MIT License
278 stars 103 forks source link

SequelizeConnectionError #5

Closed JoshHarrington closed 7 years ago

JoshHarrington commented 7 years ago

Hi there, thanks for the tutorial!

Seems that I'm getting an incorrect response when using postman to update a todo or any action (apart from a GET on the /api).

I noticed this after following the tutorial through, so thought I must have messed up somewhere. To double-check I downloaded this repo and ran the app (after running the sequelize db:migrate command). Still seem to be getting the wrong response back, compared with what the tutorial suggests I should be getting back.

Example:

GET http://127.0.0.1:8000/api/todos (using Postman, no headers or auth set)

Response:

    "name": "SequelizeConnectionError",
    "parent": {
        "name": "error",
        "length": 99,
        "severity": "FATAL",
        "code": "28000",
        "file": "miscinit.c",
        "line": "502",
        "routine": "InitializeSessionUserId"
    },
    "original": {
        "name": "error",
        "length": 99,
        "severity": "FATAL",
        "code": "28000",
        "file": "miscinit.c",
        "line": "502",
        "routine": "InitializeSessionUserId"
    }

Am I missing something here? Any help very welcome!

benfluleck commented 7 years ago

Unfortunately i can't see your code but are you sure you have a connection with the db. Case sensitivity can be a pain. Also I created my db in PSQL just to be sure.

JoshHarrington commented 7 years ago

@benfluleck Thanks for the info, I'll have another look into it soon.