Node.js 从零开发 web server博客项目[项目介绍]
web server博客项目
- Node.js 从零开发 web server博客项目[项目介绍]
- Node.js 从零开发 web server博客项目[接口]
- Node.js 从零开发 web server博客项目[数据存储]
- Node.js 从零开发 web server博客项目[登录]
- Node.js 从零开发 web server博客项目[日志]
- Node.js 从零开发 web server博客项目[安全]
- Node.js 从零开发 web server博客项目[express重构博客项目]
- Node.js 从零开发 web server博客项目[koa2重构博客项目]
- Node.js 从零开发 web server博客项目[上线与配置]
文章目录
项目需求
- 首页 , 作者主页 , 博客详情页
- 登录页
- 管理中心 , 新建页 , 编辑页
技术方案
数据存储
博客
| id | title | constent | createtime | author |
|---|---|---|---|---|
| 1 | 标题1 | 内容1 | 1542512945445 | 张三 |
| 2 | 标题2 | 内容2 | 1542511215145 | 李四 |
用户
| id | username | password | realname |
|---|---|---|---|
| 1 | zhangsan | 1234 | 张三 |
| 2 | lisi | 0000 | 李四 |
接口设计
| 描述 | 接口 | 方法 | url参数 | 备注 |
|---|---|---|---|---|
| 获取博客列表 | /api/blog/list | get | author作者, keyword 搜索关键字 | 参数为空的话, 则不进行查询过滤 |
| 获取一篇博客的内容 | /api/blog/detail | get | id | |
| 新增一篇博客 | /api/blog/new | post | post中有新增的信息 | |
| 更新一篇博客 | /api/blog/update | post | id | postData 中有更新的内容 |
| 删除一篇博客 | /api/blog/del | post | id | |
| 登录 | /api/user/login | post | postData 中有用户名和密码 |
开发接口(不用任何框架)
nodejs 处理 http 请求
搭建开发环境
开发接口(暂不连接数据库, 暂不考虑登录)
postman json文件
{
"id": "9b059257-accf-6ced-b372-c8b2c1a593bf",
"name": "Node.js 从零开发 web server博客项目 前端晋升全栈工程师必备",
"description": "",
"order": [
"53fadbd2-4bf8-d99c-c4bc-2bad9a9acc4a",
"e9955442-b3a0-270c-5e01-a5a6a3c91e60",
"b13f5e19-ab33-3c9f-63cd-5366015761d6",
"34d0396f-00a4-1691-23ad-ae1de6136fda",
"f24bb99d-dd8c-c181-5d44-9227d7066902",
"e52e4d10-bc5a-685d-77db-bf13871848f6"
],
"folders": [],
"folders_order": [],
"timestamp": 1562430570180,
"owner": "7741397",
"public": false,
"requests": [
{
"id": "34d0396f-00a4-1691-23ad-ae1de6136fda",
"headers": "Content-Type: application/json\n",
"headerData": [
{
"key": "Content-Type",
"value": "application/json",
"description": "",
"enabled": true
}
],
"url": "localhost:9527/api/blog/update?id=7",
"queryParams": [
{
"key": "id",
"value": "7",
"equals": true,
"description": "",
"enabled": true
}
],
"preRequestScript": null,
"pathVariables": {},
"pathVariableData": [],
"method": "POST",
"data": [],
"dataMode": "raw",
"tests": null,
"currentHelper": "normal",
"helperAttributes": {},
"time": 1562438278080,
"name": "更新一篇博客",
"description": "",
"collectionId": "9b059257-accf-6ced-b372-c8b2c1a593bf",
"responses": [],
"rawModeData": "{\n\t\"title\": \"文章c\",\n\t\"content\": \"内容c\"\n}"
},
{
"id": "53fadbd2-4bf8-d99c-c4bc-2bad9a9acc4a",
"headers": "",
"headerData": [],
"url": "localhost:9527/api/blog/list?keyword=2",
"queryParams": [
{
"key": "keyword",
"value": "2",
"equals": true,
"description": "",
"enabled": true
}
],
"preRequestScript": null,
"pathVariables": {},
"pathVariableData": [],
"method": "GET",
"data": null,
"dataMode": "params",
"tests": null,
"currentHelper": "normal",
"helperAttributes": {},
"time": 1562435228053,
"name": "获取博客列表",
"description": "",
"collectionId": "9b059257-accf-6ced-b372-c8b2c1a593bf",
"responses": []
},
{
"id": "b13f5e19-ab33-3c9f-63cd-5366015761d6",
"headers": "Content-Type: application/json\n",
"headerData": [
{
"key": "Content-Type",
"value": "application/json",
"description": "",
"enabled": true
}
],
"url": "localhost:9527/api/blog/new",
"queryParams": [],
"preRequestScript": null,
"pathVariables": {},
"pathVariableData": [],
"method": "POST",
"data": [],
"dataMode": "raw",
"tests": null,
"currentHelper": "normal",
"helperAttributes": {},
"time": 1562438281853,
"name": "新增一篇博客",
"description": "",
"collectionId": "9b059257-accf-6ced-b372-c8b2c1a593bf",
"responses": [],
"rawModeData": "{\n\t\"title\": \"文章B\",\n\t\"content\": \"内容B\"\n}"
},
{
"id": "e52e4d10-bc5a-685d-77db-bf13871848f6",
"headers": "Content-Type: application/json\n",
"headerData": [
{
"key": "Content-Type",
"value": "application/json",
"description": "",
"enabled": true
}
],
"url": "localhost:9527/api/user/login",
"queryParams": [],
"pathVariables": {},
"pathVariableData": [],
"preRequestScript": null,
"method": "POST",
"collectionId": "9b059257-accf-6ced-b372-c8b2c1a593bf",
"data": [],
"dataMode": "raw",
"name": "登录",
"description": "",
"descriptionFormat": "html",
"time": 1562439940328,
"version": 2,
"responses": [],
"tests": null,
"currentHelper": "normal",
"helperAttributes": {},
"rawModeData": "{\n\t\"username\": \"zhangsan\",\n\t\"password\": 123\n}"
},
{
"id": "e9955442-b3a0-270c-5e01-a5a6a3c91e60",
"headers": "",
"headerData": [],
"url": "http://localhost:9527/api/blog/detail?id=2",
"queryParams": [
{
"key": "id",
"value": "2",
"equals": true,
"description": "",
"enabled": true
}
],
"pathVariables": {},
"pathVariableData": [],
"preRequestScript": null,
"method": "GET",
"collectionId": "9b059257-accf-6ced-b372-c8b2c1a593bf",
"data": null,
"dataMode": "params",
"name": "获取一篇博客的内容",
"description": "",
"descriptionFormat": "html",
"time": 1562435340139,
"version": 2,
"responses": [],
"tests": null,
"currentHelper": "normal",
"helperAttributes": {}
},
{
"id": "f24bb99d-dd8c-c181-5d44-9227d7066902",
"headers": "Content-Type: application/json\n",
"headerData": [
{
"key": "Content-Type",
"value": "application/json",
"description": "",
"enabled": true
}
],
"url": "localhost:9527/api/blog/del?id=7",
"queryParams": [
{
"key": "id",
"value": "7",
"equals": true,
"description": "",
"enabled": true
}
],
"pathVariables": {},
"pathVariableData": [],
"preRequestScript": null,
"method": "POST",
"collectionId": "9b059257-accf-6ced-b372-c8b2c1a593bf",
"data": [],
"dataMode": "raw",
"name": "删除一篇博客",
"description": "",
"descriptionFormat": "html",
"time": 1562439876334,
"version": 2,
"responses": [],
"tests": null,
"currentHelper": "normal",
"helperAttributes": {},
"rawModeData": "{\n\t\"author\": \"zhangsan\"\n}"
}
]
}
Node.js 从零开发 web server博客项目[项目介绍]的更多相关文章
- Node.js 从零开发 web server博客项目[express重构博客项目]
web server博客项目 Node.js 从零开发 web server博客项目[项目介绍] Node.js 从零开发 web server博客项目[接口] Node.js 从零开发 web se ...
- Node.js 从零开发 web server博客项目[数据存储]
web server博客项目 Node.js 从零开发 web server博客项目[项目介绍] Node.js 从零开发 web server博客项目[接口] Node.js 从零开发 web se ...
- Node.js 从零开发 web server博客项目[koa2重构博客项目]
web server博客项目 Node.js 从零开发 web server博客项目[项目介绍] Node.js 从零开发 web server博客项目[接口] Node.js 从零开发 web se ...
- Node.js 从零开发 web server博客项目[安全]
web server博客项目 Node.js 从零开发 web server博客项目[项目介绍] Node.js 从零开发 web server博客项目[接口] Node.js 从零开发 web se ...
- Node.js 从零开发 web server博客项目[日志]
web server博客项目 Node.js 从零开发 web server博客项目[项目介绍] Node.js 从零开发 web server博客项目[接口] Node.js 从零开发 web se ...
- Node.js 从零开发 web server博客项目[登录]
web server博客项目 Node.js 从零开发 web server博客项目[项目介绍] Node.js 从零开发 web server博客项目[接口] Node.js 从零开发 web se ...
- Node.js 从零开发 web server博客项目[接口]
web server博客项目 Node.js 从零开发 web server博客项目[项目介绍] Node.js 从零开发 web server博客项目[接口] Node.js 从零开发 web se ...
- Vue+node.js实现一个简洁的个人博客系统
本项目是一个用vue和node以及mysql实现的一个简单的个人博客系统,整体逻辑比较简单.但是可以我们完整的了解一个项目从数据库到后端到前端的实现过程,适合不太懂这一块的朋友们拿来练手. 本项目所用 ...
- github pages + Hexo + node.js 搭建属于自己的个人博客网站
之前我写过一篇用Github实现个人主页的博客:https://www.cnblogs.com/tu-0718/p/8081288.html 后来看到某个大佬写的文章:[5分钟 0元搭建个人独立 ...
随机推荐
- JAVA HTML 以压缩包下载多文件
Html: 利用form表单来发送下载请求 <form id ="submitForm" method="post"> </form> ...
- mysql-STRAIGHT_JOIN-优化
性能提升神器-STRAIGHT_JOIN,在数据量大的联表查询中灵活运用的话,能大大缩短查询时间. 首先来解释下STRAIGHT_JOIN到底是用做什么的: STRAIGHT_JOIN is simi ...
- JavaScript学习系列博客_28_JavaScript 数组去重
数组去重 var arr = [1,2,3,2,2,1,3,4,2,5]; //去除数组中重复的数字 //获取数组中的每一个元素 for(var i=0 ; i<arr.length ; i++ ...
- Solon详解(四)- Solon的事务传播机制
在前面的篇章里我们已经见识了 Solon 对事务的控制,及其优雅曼妙的形态.该篇将对事务的传播机制做讲解.出于对用户的学习成本考虑,Solon 借签了Spring 的事务传播策略:并友好的支持多数据源 ...
- Eligibility Traces and Plasticity on Behavioral Time Scales: Experimental Support of neoHebbian Three-Factor Learning Rules
郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! Abstract 大多数基本行为,如移动手臂抓住物体或走进隔壁房间探索博物馆,都是在几秒钟的时间尺度上进化的:相反,神经元动作电位则是在几 ...
- 第3关-input()函数
第3关-input()函数 一.input()函数 import time print('亲爱的同学:') time.sleep(1) print('我们愉快地通知您,您已获准在霍格沃茨魔法学校就读. ...
- Htmlcss学习笔记2——选择器与常用样式
CSS引入类型 行内样式 内联样式 外部样式表 CSS选择器 基本选择器 复合选择器 伪类选择器 属性选择器 CSS字体样式 font-size font-family font-style font ...
- 手写Promise看着一篇就足够了
目录 概要 博客思路 API的特性与手写源码 构造函数 then catch Promise.resolved Promise.rejected Promise.all Promise.race 概要 ...
- laravel发送邮件配置
1.设置发送方,即邮件服务器,可以使用163邮箱,设置smtp,开启后获取授权码 2.在env文件配置 MAIL_DRIVER=smtpMAIL_HOST=smtp.163.com //邮箱服务器M ...
- Python爬虫实战 批量下载高清美女图片
彼岸图网站里有大量的高清图片素材和壁纸,并且可以免费下载,读者也可以根据自己需要爬取其他类型图片,方法是类似的,本文通过python爬虫批量下载网站里的高清美女图片,熟悉python写爬虫的基本方法: ...