NodeJS postgreSQL

https://github.com/cardfaux/postgreSQL
this is the link to the github page i have the code for the following question…

I create a database called newsdb with 2 tables. 1 table is called users with 3 columns userid, username, password. the other table is called articles with 6 columns articleid, body, title, datecreated, dateupdated, and userid… I made a foreign key called articles_userid_foreign_key local column set to userid, referencing public.users table, referencing userid column. when i register a user the userid, password, username, get stored to the users table. After i log in and post a article. The articleid, title, body get posted on the articles table but the datecreated, dateupdated, and userid is null… I know i probley dont have the datecreated and dateupdated configured properly but the userid should be getting posted. Why am i not getting the corresponding userid that made the post in the userid column of the articles table?