Install mysql
server, and create a new user.
CREATE USER '<username>'@'127.0.0.1' IDENTIFIED BY '<password>';
GRANT ALL ON upvotr.* TO '<username>'@'127.0.0.1';
Create an environment variable named SECRET
with a randomized secret for cookie signing.
Create a file server/mysql-login.secret.json
with:
{
"user": "<username>",
"password": "<password>"
}
Create a file server/admins.secret.json
, a json array containing the usernames of users who should be marked as admin by default. Ex:
["World_Languages", "ErrorGamer2000"]
Run npm install
then run npm run build
.
To start, simply run npm start
.
There are three categories of webhook events:
Post
related eventsComment
related eventsTag
related events
When these events are emitted by the server, an application/json POST
request is sent to the configured url with the following data, based on the event type:
interface PostWebhookData {
postId: number;
url: string;
title: string;
previewSnippet: string;
authorName: string;
authorId: string;
}
interface CommentWebhookData {
postId: number;
commentId: number;
url: string;
authorName: string;
authorId: string;
}
interface TagWebhookData {
tagId: number;
tagName: string;
colors: {
background: string;
text: string;
};
postId: number;
tagPrivate: boolean;
}
Files inside the static-content
folder are named according to who will see them and/or where they will be shown. However, editing these files will require a full rebuild (at the moment).