yet another pastebin and url shortener
wastebin requires a few environment variables. create a .env file in the root directory with these variables
TRUST_PROXY- (optional) if you're running behind a reverse proxy, set this totrueSESSION_SECRET- the session cookie secretENABLE_REGISTER- (optional, default: true) if you want to disable registration, set this tofalseDB_HOST- the host of your mysql serverDB_USER- the username of your mysql serverDB_DATABASE- the name of your databaseDB_PASSWORD- the password of your mysql userDB_PORT- (optional, default: 3306) the port of your mysql server
there are a few npm scripts to make it easier for you to get started
start- start the serverbuild- compile the typescript to javascripttest- run typescript with--noEmit
wastebin uses knex for database migrations. you can run knex commands using the following commands
- to create a new migration
npx knex --knexfile src/knexfile.ts migrate:make <name>- to run the latest migrations
$ npx knex --knexfile src/knexfile.ts migrate:latestthere is a docker compose file that has mysql and adminer to get a database up quickly. to start docker compose, run docker-compose up -d and set your database environment variables to
DB_HOST=localhost
DB_USER=wastebin
DB_DATABASE=wastebin
DB_PASSWORD=wastebin