Skip to content

wfloat/api

Repository files navigation

API

Temporary fix

Starting

# Change directories into the api folder. Example:
cd ~/dev/wfloat/api

# Start the Postgres database and PGAdmin
docker compose up

# Open http://localhost:5050 in the web browser to view PGAdmin

# Start the API
npm run start

# Open http://localhost:4000 in the web browser to view the Apollo GraphQL server

Debugging

# Run this instead of npm run start:
npm run build

# Press the "Run and debug" tab in VSCode on the left nav bar
# Press the green play button
# Place breakpoints as needed

Getting started

cp .env.example .env
docker compose up

Usage

Launch

npm run start

Debug

npm run build

In vscode select the run and debug tab. Launch index.ts.

Code generation

npm run codegen

Backup database

# Backup
pg_dump -U postgres -h localhost -p 5432 wfloat-local | gzip > "wfloat-local_$(date '+%Y-%m-%d_%H-%M-%S').sql.gz"

# Restore
# copy the database backup into the dump folder, run the command in the docker container

gunzip -c wfloat-local_YYYY-MM-DD_HH-MM-SS.sql.gz | psql -U postgres -h localhost -p 5432 wfloat-local

TODO

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published