diff --git a/README.md b/README.md index 46fb4be..3ad29b8 100644 --- a/README.md +++ b/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 diff --git a/docker-compose.yml b/docker-compose.yml index 80569f8..0ffdb70 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx index 602bff1..ac63cdc 100644 --- a/src/app/global-error.tsx +++ b/src/app/global-error.tsx @@ -6,11 +6,7 @@ import { CardTitle } from "@/components/ui/card"; -export default function GlobalError({ - error, -}: { - error: Error & { digest?: string } -}) { +export default function GlobalError() { return ( diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 8db8326..9b65bbe 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -6,11 +6,7 @@ import { CardTitle } from "@/components/ui/card"; -export default function GlobalError({ - error, -}: { - error: Error & { digest?: string } -}) { +export default function NotFound() { return ( diff --git a/src/app/stats/db.tsx b/src/app/stats/db.tsx index d743da8..310a74a 100644 --- a/src/app/stats/db.tsx +++ b/src/app/stats/db.tsx @@ -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]; diff --git a/src/app/stats/page.tsx b/src/app/stats/page.tsx index e5b96e7..4be0f15 100644 --- a/src/app/stats/page.tsx +++ b/src/app/stats/page.tsx @@ -13,7 +13,6 @@ export default function StatsPage() { useEffect(() => { const fetchData = async () => { const result = await querydb(); - console.log(result); // @ts-ignore setData(result); };