add example message

This commit is contained in:
Tykayn 2022-07-07 19:33:11 +02:00 committed by tykayn
parent b92e5bd049
commit bc61b8ed76
3 changed files with 8 additions and 5 deletions

Binary file not shown.

View File

@ -88,24 +88,27 @@ router.get('/list', function (req, res, next) {
});
router.get('/add-to-db-example', function (req, res, next) {
let db = connect(database_masto);
router.get('/add-example', function (req, res, next) {
// let db = connect(database_masto);
async function prepare() {
await db.query(sql`
insert into posts_scheduled
values (NULL, "modominem", "un message d'example", "un jour")
values (NULL, "modominem", "un message d'example", "image.jpg",NULL)
;
`).then(resp => {
console.log(resp)
let posts_list = []
res.render('database', {posts_list: posts_list});
res.redirect('/list')
},
err => {
console.log(err)
});
}
const prepared = prepare();
}
);

View File

@ -10,6 +10,6 @@ html
a(href="/") ajouter
a(href="/init-db") init DB
a(href="/list") list DB
a(href="/add-to-db-example") ajout à la file example
a(href="/add-example") ajout à la file example
block content