One way of deploying this server is behind nginx, with the pm2 package to manage the server process, and a local postgres database. Some details on this are presented here as a rough guide to any parts of this stack which may be unfamiliar.
-- Have NodeJS 12-ish available.
+- Have NodeJS 14-ish available.
- Have PostgreSQL available.
- Clone the server repository.
```git clone https://git.squeep.com/websub-hub```
- Prepare PostgreSQL with a user and database, using e.g. ```psql```.
> <pre>
> CREATE ROLE websubhub WITH CREATEDB LOGIN PASSWORD 'mypassword';
- > GRANT websubhub TO postgres
+ > GRANT websubhub TO postgres;
> CREATE DATABASE websubhub OWNER=websubhub;
> GRANT ALL PRIVILEGES ON DATABASE websubhub TO websubhub;
> \c websubhub
- enum.js - invariants
- errors.js - local Error types
- link-helper.js - processes Link headers
- - logger.js - a very simple logging class
+ - logger/ - adds service-specific data filters to our logging module
- manager.js - process incoming requests
- service.js - defines incoming endpoints, linking the API server framework to the manager methods
- template/ - HTML content