• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
LilyLiya
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  Node JS

Defining RESTful Routes(CRUD operations)

摘要:。 const methodOverride = require('method-override') const { v4: uuid } = require('uuid'); //For generating ID's // To 'fake' put/patch/delete requests: app.use(methodOverride('_method')) 阅读全文
posted @ 2021-02-08 10:13 LilyLiya 阅读(101) 评论(0) 推荐(0)
EJS & Partials

摘要:<%- include(' ') %> 阅读全文
posted @ 2021-02-04 05:06 LilyLiya 阅读(111) 评论(0) 推荐(0)
bootstrap + express

摘要:bootstrap_navbar + express 阅读全文
posted @ 2021-02-03 13:37 LilyLiya 阅读(231) 评论(0) 推荐(0)
Serving Static Assets In Express

摘要:app.use(express.static(path.join(__dirname, 'public'))); 阅读全文
posted @ 2021-02-03 12:21 LilyLiya 阅读(58) 评论(0) 推荐(0)
Subreddit demo with data.json file

摘要:...data 阅读全文
posted @ 2021-02-03 11:45 LilyLiya 阅读(166) 评论(0) 推荐(0)
loops in EJS

摘要:simple example: baby cats lists 阅读全文
posted @ 2021-02-03 09:37 LilyLiya 阅读(64) 评论(0) 推荐(0)
if else in EJS

摘要:<% %> VS <%= %> 阅读全文
posted @ 2021-02-03 09:17 LilyLiya 阅读(193) 评论(0) 推荐(0)
subreddit demo of ejs: pass parameters into pjs

摘要:const { subreddit } = req.params; 阅读全文
posted @ 2021-02-03 09:04 LilyLiya 阅读(94) 评论(0) 推荐(0)
EJS interpolation syntax : pass data to templates

摘要:在ejs文件中使用js的数学公式,生成随机数字。 <%= Math.floor(Math.random()*10) + 1 %> res.render('random.ejs', {bubble: num}) <%= bubble %> 阅读全文
posted @ 2021-02-03 08:37 LilyLiya 阅读(111) 评论(0) 推荐(0)
Creating Servers with Express

摘要:Request & Response Objects; Express Routing Basics; Express Path Parameters; Working With Query Strings; Auto-Restart With Nodemon 阅读全文
posted @ 2021-02-03 08:05 LilyLiya 阅读(95) 评论(0) 推荐(0)
configuring express for ejs

摘要:app.set('view engine', 'ejs'); res.render('home.ejs') ; setting the views directory; const path = require('path'); app.set('views', path.join(__dirname, '/views')) //__dirname is where index.js is located 阅读全文
posted @ 2021-02-03 08:03 LilyLiya 阅读(91) 评论(0) 推荐(0)
node-group-chat exercise

摘要:npm install 阅读全文
posted @ 2021-02-01 06:34 LilyLiya 阅读(76) 评论(0) 推荐(0)
The NPM(Node Package Manager) Universe

摘要:npm i colors; npm i -g cowboy; npm init; npm install; npm link cowsay(adding global package: cowsay) 阅读全文
posted @ 2021-02-01 06:26 LilyLiya 阅读(94) 评论(0) 推荐(0)
Exploring Modules

摘要:module.exports; Requiring a directory 阅读全文
posted @ 2021-01-31 04:24 LilyLiya 阅读(55) 评论(0) 推荐(0)
Node js Intro

摘要:node xx.js; process.argv; Use file system to creat folder and files; const fs = require('fs'); mkdirSync; writeFileSync 阅读全文
posted @ 2021-01-30 01:48 LilyLiya 阅读(124) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3