A simple user app using tinyhttp and PostgreSQL.
tinyhttp new postgresqlPostgreSQL Wiki has a good list of guides for installing postgres on different operating systems.
Use createdb to create a database
createdb [dbname]
Create .env file
touch .env
Then add DB_CONNECTION=<POSTGRESQL_URL> to the .env file. PostgreSQL URL is broken down to:
postgres://YourUserName:YourPassword@YourHostname:5432/YourDatabaseName
node index.js-
GET /users- list users -
GET /users/:id- get user by id -
POST /users- create a user from a providedname -
DELETE /users- delete a user with specified id -
PUT /users- update a user by ID from a providedname