removed root_post_id, added options to post
This commit is contained in:
parent
5a229b3f13
commit
07e5c1b945
15
src/index.js
15
src/index.js
|
@ -5,6 +5,7 @@ const dotenv = require('dotenv');
|
||||||
const MemoryStore = require('memorystore')(session);
|
const MemoryStore = require('memorystore')(session);
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const bcrypt = require('bcryptjs');
|
const bcrypt = require('bcryptjs');
|
||||||
|
const fileupload = require('express-fileupload');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
@ -65,6 +66,18 @@ app.get('/', (req, res) => {
|
||||||
res.render('index');
|
res.render('index');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.post('/api/uploadMedia', async (req, res) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
app.post('/api/post', async (req, res) => {
|
||||||
|
const { content, } = req.body;
|
||||||
|
});
|
||||||
|
|
||||||
|
app.post('/api/createThread', async (req, res) => {
|
||||||
|
const { threadName, isLocked, isPinned } = req.body;
|
||||||
|
});
|
||||||
|
|
||||||
app.get('/api/getBoards', async (req, res) => {
|
app.get('/api/getBoards', async (req, res) => {
|
||||||
let queryRes = await db.query('SELECT * FROM boards');
|
let queryRes = await db.query('SELECT * FROM boards');
|
||||||
|
|
||||||
|
@ -91,7 +104,7 @@ app.post('/api/login', async (req, res) => {
|
||||||
currentSession.token = token;
|
currentSession.token = token;
|
||||||
console.log(token);
|
console.log(token);
|
||||||
}
|
}
|
||||||
res.redirect("/index");
|
res.redirect("/");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue