Skip to content

Commit a6c7e32

Browse files
committed
committing before working on new thing
1 parent dbeda0f commit a6c7e32

File tree

7 files changed

+69
-19
lines changed

7 files changed

+69
-19
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto eol=lf
2+
*.lockb binary diff=lockb

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
31
# dependencies
42
/node_modules
53

@@ -17,7 +15,7 @@
1715
tmp/
1816

1917
# sqlite stuff :p
20-
*.db
18+
*.sqlite3
2119

2220
# private testing stuff :p
2321
h.ts

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# SQLite Reader
2-
[A web app where you can view your SQLite database](https://sqlitereader.com)
2+
[A web app where you can view your SQLite database](https://sqlitereader.com)
3+
4+
# API Documentation
5+
sqlitereader.com comes with an API. Below are the routes **and all routes are post requests**

pages/api/convert.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { NextApiRequest, NextApiResponse } from "next";
2+
3+
export default async function handler(
4+
req: NextApiRequest,
5+
res: NextApiResponse,
6+
) {
7+
res.status(501).json({ error: "Not Implemented" });
8+
9+
return;
10+
}
11+
12+
// Disable body parser so that we can handle binary files
13+
export const config = {
14+
api: {
15+
bodyParser: false,
16+
},
17+
};

pages/api/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { NextApiRequest, NextApiResponse } from "next";
2+
3+
export default async function handler(
4+
req: NextApiRequest,
5+
res: NextApiResponse,
6+
) {
7+
res.status(308).redirect(
8+
"https://github.com/GalvinPython/sqlite-viewer/blob/main/README.md",
9+
);
10+
11+
return;
12+
}

pages/index.tsx

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { useState, useEffect } from "react";
44
import { SiSqlite, SiGithub } from "react-icons/si";
5-
import { FaCloudUploadAlt, FaDatabase } from "react-icons/fa";
5+
import { FaCloudUploadAlt, FaDatabase, FaLock } from "react-icons/fa";
66

77
interface TabsProps {
88
tabs: string[];
@@ -60,7 +60,9 @@ export default function Home() {
6060
if (!file) return alert("Please select a file first.");
6161

6262
if (file.size > 50 * 1024 * 1024) {
63-
return alert("File size exceeds the 50MB limit.");
63+
return alert(
64+
"File size exceeds the 50MB limit. That's a good thing though because unless you're NASA, your pc would probably explode.",
65+
);
6466
}
6567

6668
const fileExtension = file.name.split(".").pop()?.toLowerCase();
@@ -168,19 +170,33 @@ export default function Home() {
168170
<SiSqlite />
169171
SQLite Reader
170172
</h1>
171-
<a
172-
className="px-4 py-2 rounded hover:bg-blue-600 transition inline-flex items-center gap-2"
173-
href="https://github.com/GalvinPython/sqlite-viewer"
174-
rel="noopener noreferrer"
175-
style={{
176-
backgroundColor: "var(--button-bg)",
177-
color: "var(--button-text-color)",
178-
}}
179-
target="_blank"
180-
>
181-
<SiGithub />
182-
View on GitHub
183-
</a>
173+
<div className="flex gap-4">
174+
<a
175+
className="px-4 py-2 rounded hover:bg-blue-600 transition inline-flex items-center gap-2"
176+
href="https://github.com/GalvinPython/sqlite-viewer"
177+
rel="noopener noreferrer"
178+
style={{
179+
backgroundColor: "var(--button-bg)",
180+
color: "var(--button-text-color)",
181+
}}
182+
target="_blank"
183+
>
184+
<SiGithub />
185+
View on GitHub
186+
</a>
187+
<button
188+
className="px-4 py-2 rounded transition inline-flex items-center gap-2 cursor-not-allowed opacity-50"
189+
style={{
190+
backgroundColor: "var(--button-bg)",
191+
color: "var(--button-text-color)",
192+
}}
193+
title="Coming soon 👀"
194+
onClick={(e) => e.preventDefault()}
195+
>
196+
<FaLock />
197+
Coming Soon
198+
</button>
199+
</div>
184200
</header>
185201

186202
<div className="flex justify-center mb-12">

public/robots.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Disallow:

0 commit comments

Comments
 (0)