Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Friendship-App/friendship-backend-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Friendship backend

Backend for Friendship.

To develop first create a postgres database and run databases migrations with

export DATABASE_URL='postgres://user:password@host:port/databasename'
npm run db:migrate

The default is database friendship on localhost with user postgres and no password.

At the moment the backend requires a connection to the actual AWS S3 even locally, so set that up and give credentials in environment variables and run auto-restarting backend with

export AWS_ACCESS_KEY_ID=accesskey
export AWS_SECRET_ACCESS_KEY=secret_accesskey
export DATABASE_URL='postgres://user:password@host:port/databasename'
npm run watch

About migrations

The migrations that start with 00 are legacy and have to be kept with those names because they exist in production. Create any new migrations with

npx knex migrate:make <name-of-migration>

These will be conveniently after the 00 ones and of course themselves are internally in order thanks to knex naming them after timestamps.

To run migrations in production, do

heroku run knex migrate:latest --knexfile db/knexfile.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published