Server software which searches YouTube comments for Justin Y. and stores the result for cached access.
Clone the repository and run
npm install
Afterwards create a file called .env
where you need to define the following environment variables:
NODE_ENV
Set this to"production"
.SQLITE_PATH
Path where you want the sqlite database to be placedAPI_KEY
API key from the google API consolePORT
Port to bind the webserver toADDRESS
[optional] Address to bind the webserver to (Default:""
, which means all addresses)LOG
[optional] Set the loglevel (See the loglevel docs for allowed values) (Default:"error"
)RECHECK_DELAY
[optional] Number of seconds after which a video is queried again if no comment could be found the last time. (Default: 604800)TRACKING_CODE_FILE
[optional] Specify the path of a file containing some additional text/code to be included in the header. The path can either be absolute, or relative to the views/ directory.ALLOW_DB_DOWNLOAD
[optional] Allow downloading the entire database on the/api/entire-db
endpoint.
After you have set your environment variables install the knex
cli:
npm i -g knex
and run
knex migrate:latest --env production
to initialize the database.
If you have installed everything, simply run
NODE_ENV="production" node ./
to start the server.
You can simply pull this repo to get all the updated features. Afterwards you need to run
knex migrate:latest --env production
again, to update the database with new/changed tables.