wip: move workstation

This commit is contained in:
2023-10-21 10:17:10 +11:00
parent 08db8ef124
commit 6d3dab582a
11 changed files with 760 additions and 6 deletions

21
app/dbcheck/page.tsx Normal file
View File

@@ -0,0 +1,21 @@
import { promisePool } from "@/backend/db";
import {RowDataPacket} from "mysql2";
async function query() {
try {
const [rows, fields] = await promisePool.query<RowDataPacket[]>('select slug from post limit 1;')
return(rows[0]['slug'] as string)
} catch (e) {
console.log(e)
return('something went wrong')
}
}
export default async function DbCheck() {
return(
<div className={`flex flex-col`}>
<p>Env: { process.env.MYSQL_HOST }</p>
<p>Result: { await query() }</p>
</div>
)
}