Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 36c309a69c | |||
| 3f55ad71cf | |||
| f8ec31ff7e | |||
| 739311928f | |||
| 78cda0fe50 | |||
| 7d40005e7d | |||
| 855de182ea | |||
| a96e7d9344 |
@@ -0,0 +1,5 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
patreon: krgamestudios
|
||||||
|
ko_fi: krgamestudios
|
||||||
|
custom: ["https://www.paypal.com/donate/?hosted_button_id=73Q82T2ZHV8AA"]
|
||||||
@@ -15,7 +15,7 @@ POST https://dev-auth.krgamestudios.com/auth/login HTTP/1.1
|
|||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"email": "kayneruse@gmail.com",
|
"email": "example@example.com",
|
||||||
"password": "helloworld"
|
"password": "helloworld"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -48,6 +48,7 @@ GET /news/archive/:id
|
|||||||
"title": title, //title of the article
|
"title": title, //title of the article
|
||||||
"author": author, //author of the aricle
|
"author": author, //author of the aricle
|
||||||
"body": body, //body of the article
|
"body": body, //body of the article
|
||||||
|
"rendered": rendered //body rendered as HTML
|
||||||
"edits": edits //number of times this article has been edited
|
"edits": edits //number of times this article has been edited
|
||||||
"createdAt": createdAt //time created
|
"createdAt": createdAt //time created
|
||||||
"updatedAt": updatedAt //time updated
|
"updatedAt": updatedAt //time updated
|
||||||
|
|||||||
Generated
+892
-597
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "news-server",
|
"name": "news-server",
|
||||||
"version": "1.4.0",
|
"version": "1.4.3",
|
||||||
"description": "An API centric news server. Uses Sequelize and mariaDB by default.",
|
"description": "An API centric news server. Uses Sequelize and mariaDB by default.",
|
||||||
"main": "server/server.js",
|
"main": "server/server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
const { Op } = require('sequelize');
|
const { Op } = require('sequelize');
|
||||||
const { articles, revisions } = require('../database/models');
|
const { articles, revisions } = require('../database/models');
|
||||||
const markdownIt = require('markdown-it')();
|
const markdownIt = require('markdown-it')({ html: true });
|
||||||
|
|
||||||
const route = async (req, res) => {
|
const route = async (req, res) => {
|
||||||
//get the existing record
|
//get the existing record
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ router.get('/archive/metadata/:id(\\d+)', query(true, true));
|
|||||||
//use middleware to authenticate the rest of the routes
|
//use middleware to authenticate the rest of the routes
|
||||||
router.use(authToken);
|
router.use(authToken);
|
||||||
router.use((req, res, next) => {
|
router.use((req, res, next) => {
|
||||||
if (req.user.admin) {
|
if (req.user.mod) {
|
||||||
next();
|
next();
|
||||||
} else {
|
} else {
|
||||||
res.status(403).end();
|
res.status(403).end();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const { articles } = require('../database/models');
|
const { articles } = require('../database/models');
|
||||||
const markdownIt = require('markdown-it')();
|
const markdownIt = require('markdown-it')({ html: true });
|
||||||
|
|
||||||
const route = async (req, res) => {
|
const route = async (req, res) => {
|
||||||
//check for missing data
|
//check for missing data
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ server.listen(process.env.WEB_PORT || 3100, async (err) => {
|
|||||||
await database.sync();
|
await database.sync();
|
||||||
console.log(`listening to localhost:${process.env.WEB_PORT || 3100}`);
|
console.log(`listening to localhost:${process.env.WEB_PORT || 3100}`);
|
||||||
|
|
||||||
//parse the unrendered data from the database
|
//COMPATABILITY: parse the unrendered data from the database
|
||||||
const markdownIt = require('markdown-it')();
|
const markdownIt = require('markdown-it')();
|
||||||
const { articles, revisions } = require('./database/models');
|
const { articles, revisions } = require('./database/models');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user