subreddit demo of ejs: pass parameters into pjs

2021-02-05 04:14

阅读:587

标签:pass   index   src   技术   ons   com   const   int   post   

index.js

app.get(‘/r/:subreddit‘, (req, res) => {
    const { subreddit } = req.params;
    res.render(‘subreddit‘, { subreddit })
})
subreddit.ejs 

body>
    h1>The post is = subreddit %> posth1>
body>

技术图片

subreddit demo of ejs: pass parameters into pjs

标签:pass   index   src   技术   ons   com   const   int   post   

原文地址:https://www.cnblogs.com/LilyLiya/p/14365208.html


评论


亲,登录后才可以留言!