fixed
This commit is contained in:
parent
e4b6b9b86a
commit
51f422874f
6 changed files with 25 additions and 20 deletions
13
README.md
13
README.md
|
@ -1,3 +1,16 @@
|
|||
# Install
|
||||
Copy [docker-compose.yml](./docker-compose.yml)
|
||||
|
||||
Create data folder next to docker-compose.yml and .env, and set the data type in .env
|
||||
```
|
||||
├── data
|
||||
│ └── surrealdb
|
||||
├── docker-compose.yml
|
||||
└── .env
|
||||
```
|
||||
|
||||
`docker compose up --pull always -d`
|
||||
|
||||
## Example .env
|
||||
```
|
||||
# If not using docker, use 0.0.0.0:8000
|
||||
|
|
|
@ -5,11 +5,11 @@ services:
|
|||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- 3000:3000
|
||||
depends_on:
|
||||
- surrealdb
|
||||
networks:
|
||||
- surrealdb_network
|
||||
- surrealdb-network
|
||||
|
||||
surrealdb:
|
||||
container_name: surrealdb
|
||||
|
@ -28,16 +28,16 @@ services:
|
|||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
cpus: "1"
|
||||
cpus: 1
|
||||
ports:
|
||||
- 8000:8000
|
||||
volumes:
|
||||
- ./data:/data
|
||||
networks:
|
||||
- surrealdb_network
|
||||
- surrealdb-network
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
networks:
|
||||
surrealdb_network:
|
||||
surrealdb-network:
|
||||
|
|
|
@ -6,11 +6,7 @@ import {
|
|||
CardTitle
|
||||
} from "@/components/ui/card";
|
||||
|
||||
export default function GlobalError({
|
||||
error,
|
||||
}: {
|
||||
error: Error & { digest?: string }
|
||||
}) {
|
||||
export default function GlobalError() {
|
||||
return (
|
||||
<CardGrid max_rows={1}>
|
||||
<Card>
|
||||
|
|
|
@ -6,11 +6,7 @@ import {
|
|||
CardTitle
|
||||
} from "@/components/ui/card";
|
||||
|
||||
export default function GlobalError({
|
||||
error,
|
||||
}: {
|
||||
error: Error & { digest?: string }
|
||||
}) {
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<CardGrid max_rows={1}>
|
||||
<Card>
|
||||
|
|
|
@ -4,11 +4,12 @@ import { initConnection } from "@/components/db-utils";
|
|||
export async function querydb() {
|
||||
try {
|
||||
let db = await initConnection();
|
||||
// console.log(db);
|
||||
let stats = await db.query(`
|
||||
select * from url
|
||||
order by clicks desc
|
||||
limit 50;
|
||||
`);
|
||||
select * from url
|
||||
order by clicks desc
|
||||
limit 50;
|
||||
`);
|
||||
|
||||
// @ts-ignore
|
||||
stats = stats[0];
|
||||
|
|
|
@ -13,7 +13,6 @@ export default function StatsPage() {
|
|||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const result = await querydb();
|
||||
console.log(result);
|
||||
// @ts-ignore
|
||||
setData(result);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue