Skip to content
Source
Sign inSign up
samwillis/one-million-boxes
Open History to see the last commit

reset-game.ts

10 lines338 Bytes

1import pg from "pg"
2import { runtimeConfig } from "../server/config"
3import { GameStore } from "../server/store"
4const pool = new pg.Pool({ connectionString: runtimeConfig().databaseUrl })
5try {
6 await new GameStore(pool).reset()
7 console.log("Game reset; connected clients will reload the new board.")
8} finally {
9 await pool.end()