add example message
This commit is contained in:
parent
b92e5bd049
commit
bc61b8ed76
Binary file not shown.
@ -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();
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user