What's for lunch?
server + PostgresOne vote a click, from everyone who visits. The bars are today's votes.
0 votes today. Every vote is a row in Postgres: they are still here after the server naps, restarts or is deployed again, and the poll starts over at midnight, Prague time.
How it runs
- This is mossy starling, an example of a server with a database. Tori builds it from source and runs
npm start. The database is Tori's managed Postgres; the server finds it inDATABASE_URL, which Tori sets. - The table is created by
migrate.mjs, which Tori runs as the release command before a new deploy takes traffic. If it fails, the deploy that was live keeps serving. - This copy of the server started .
Deploy your own
git clone https://github.com/tori-host/examples
cd examples/mossy-starling
npx tori.host
npx tori.host db create
npx tori.host db status # again, until it says ready
npx tori.host env list # again, until DATABASE_URL is listed
npx tori.host deploy --release "node migrate.mjs"
The first deploy creates the service, which runs and says it has no database. The last one gives it the database and creates the table.