hop
This commit is contained in:
parent
bc61b8ed76
commit
7ab74aa7b1
Binary file not shown.
@ -116,6 +116,34 @@ router.get('/add-example', function (req, res, next) {
|
||||
// publier le message en db dans la file
|
||||
router.get('/publish-last-entry', function (req, res, next) {
|
||||
res.render('index', {title: 'Express'});
|
||||
getAllPosts(db).then(
|
||||
(results) => {
|
||||
console.log( "publier le premier message de la file d'attente" ,results[0])
|
||||
res.render('publish', {posts_list: results[0]});
|
||||
},
|
||||
(err) => console.error(err),
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
// répartir les publications dans le temps
|
||||
// TODO
|
||||
const limit_posts_per_day=10
|
||||
|
||||
router.get('/dispatch-publication-in-time', function (req, res, next) {
|
||||
res.render('index', {title: 'Express'});
|
||||
getAllPosts(db).then(
|
||||
(results) => {
|
||||
console.log( "répartir" ,results[0])
|
||||
|
||||
// on compte les posts et quel intervalle de temps mettre entre chaque pour tenir le rythme de X posts par jour
|
||||
|
||||
res.render('index', {posts_list: results[0]});
|
||||
},
|
||||
(err) => console.error(err),
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
||||
|
@ -11,5 +11,6 @@ html
|
||||
a(href="/init-db") init DB
|
||||
a(href="/list") list DB
|
||||
a(href="/add-example") ajout à la file example
|
||||
a(href="/publish-last-entry") publier premier
|
||||
|
||||
block content
|
||||
|
8
views/publish.jade
Normal file
8
views/publish.jade
Normal file
@ -0,0 +1,8 @@
|
||||
extends layout
|
||||
|
||||
block content
|
||||
h1 Publié
|
||||
div.post-message
|
||||
strong.author= p.post_username
|
||||
div.content= p.content
|
||||
img(src=p.medias)
|
Loading…
Reference in New Issue
Block a user