Compare commits

...

5 Commits

Author SHA1 Message Date
Kayne Ruse 739311928f Library updates 2022-01-20 13:38:38 +11:00
Kayne Ruse 78cda0fe50 Enabled HTML embedding 2022-01-06 11:31:11 +00:00
Kayne Ruse 7d40005e7d Bumped version number 2022-01-02 18:12:31 +00:00
Kayne Ruse 855de182ea Mods can now add and edit the news feed 2022-01-02 18:11:43 +00:00
Kayne Ruse a96e7d9344 Updated README.md 2021-12-30 13:52:13 +00:00
6 changed files with 13 additions and 12 deletions
+1
View File
@@ -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
+8 -8
View File
@@ -1,12 +1,12 @@
{ {
"name": "news-server", "name": "news-server",
"version": "1.4.0", "version": "1.4.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "news-server", "name": "news-server",
"version": "1.4.0", "version": "1.4.3",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"cors": "^2.8.5", "cors": "^2.8.5",
@@ -1172,9 +1172,9 @@
} }
}, },
"node_modules/markdown-it": { "node_modules/markdown-it": {
"version": "12.3.0", "version": "12.3.2",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.0.tgz", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz",
"integrity": "sha512-T345UZZ6ejQWTjG6PSEHplzNy5m4kF6zvUpHVDv8Snl/pEU0OxIK0jGg8YLVNwJvT8E0YJC7/2UvssJDk/wQCQ==", "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==",
"dependencies": { "dependencies": {
"argparse": "^2.0.1", "argparse": "^2.0.1",
"entities": "~2.1.0", "entities": "~2.1.0",
@@ -3025,9 +3025,9 @@
} }
}, },
"markdown-it": { "markdown-it": {
"version": "12.3.0", "version": "12.3.2",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.0.tgz", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz",
"integrity": "sha512-T345UZZ6ejQWTjG6PSEHplzNy5m4kF6zvUpHVDv8Snl/pEU0OxIK0jGg8YLVNwJvT8E0YJC7/2UvssJDk/wQCQ==", "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==",
"requires": { "requires": {
"argparse": "^2.0.1", "argparse": "^2.0.1",
"entities": "~2.1.0", "entities": "~2.1.0",
+1 -1
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -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 -1
View File
@@ -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