-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6902934
commit 1eea254
Showing
5 changed files
with
113 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
DROP TABLE IF EXISTS Visits; | ||
CREATE TABLE IF NOT EXISTS Visits ( | ||
slug TEXT PRIMARY KEY, | ||
-- DROP TABLE IF EXISTS Visits; | ||
-- CREATE TABLE IF NOT EXISTS Visits ( | ||
-- slug TEXT PRIMARY KEY, | ||
-- count INTEGER NOT NULL DEFAULT 0, | ||
-- created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
-- ); | ||
-- INSERT INTO Visits (slug, count) VALUES ('/', 0); | ||
|
||
CREATE TABLE IF NOT EXISTS Events ( | ||
event_name TEXT PRIMARY KEY, | ||
count INTEGER NOT NULL DEFAULT 0, | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
); | ||
INSERT INTO Visits (slug, count) VALUES ('/', 0); | ||
INSERT INTO Events (event_name, count) VALUES ('/', 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// use to add events that occur on the website | ||
|
||
export function addEvent(event_name: string) { | ||
if (process.env.NODE_ENV === "production") { | ||
fetch(`https://api.syrusdark.cc/api/add-event?event_name=${event_name}`) | ||
.then(res => res.json()) | ||
.then(json => { | ||
console.log(json); | ||
}) | ||
.catch(e => { | ||
console.error(e); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters