no-ssr
Yanick Champoux 2024-02-01 13:01:26 -05:00
parent 1d6bcce228
commit 0527f3b1fe
4 changed files with 20 additions and 2 deletions

15
NOTES
View File

@ -7,4 +7,19 @@ The root path for all requests in the XMLAPI2 are prefixed as follows. These que
https://rpggeek.com/xmlapi2/
https://videogamegeek.com/xmlapi2/
## Ansible stuff
create user bggsell
install fnm, nvm for it?
touch ~/.profile
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install v21.6.1
npm install -g pnpm
npm run vite build
nginx configuration
.profile => add DATABASE_URL
// DONE: add apache redirection
PORT=8097 node build/index.js

View File

@ -33,6 +33,7 @@
},
"type": "module",
"dependencies": {
"@sveltejs/adapter-node": "^4.0.1",
"@vincjo/datatables": "^1.14.4",
"beercss": "^3.4.13",
"better-sqlite3": "^9.3.0",

View File

@ -2,7 +2,8 @@ import { load } from 'cheerio';
import fetch from 'node-fetch';
import DB from 'better-sqlite3';
const db = DB('games.db');
const db_file = process.env.DATABASE_URL.replace('sqlite3:','');
const db = DB(db_file);
db.pragma('journal_mode = WAL');
export async function fetch_guild_users (guild_id) {

View File

@ -1,8 +1,9 @@
import DB from 'better-sqlite3';
const db_file = process.env.DATABASE_URL.replace('sqlite3:','');
export async function load() {
const db = DB('games.db');
const db = DB(db_file);
db.pragma('journal_mode = WAL');
return {