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元搭建个人独立 ...
随机推荐
- eclipse git提交项目以及down项目大致步骤
down git项目步骤: 复制了url之后,import projects项目选中from git ,会出现如下截图,信息会自动填充 填好信息一直Next即可 完成之后,打开“Git Reposit ...
- 第4篇 Scrum 冲刺博客(专✌️团队)
一.站立式会议 1.1会议图片 1.2成员完成情况 成员 昨天完成的任务 今天计划完成的任务 工作中的困难 陈忠明 按下载热度返回歌曲信息,与前端尝试交互 歌曲信息的上传/下载包 前后端交互问题 吴茂 ...
- tp6 不能使用vendor
从thinkphp 5.1.x后vendor的使用方法发生变化,文档又没有详细说明.官方真的太坑了! 在thinkPHP 5.1.X后新版取消了Loader::import方法以及import和ven ...
- P1227 【[JSOI2008]完美的对称】
这道题,先讲一下我的做题思路 这道题的最主要的目的就是算出中心,我下面称为中点.这个中点其实很好算的,我们只需要算出最左下角的坐标和最右上角的坐标,然后用中点坐标公式算出来就ok了,那么这道题就做完了 ...
- 热门话题,2020年了,web前端还好找工作吗?
#大师助手-全网唯一免费上pin 如果你要是和前几年的前端市场相比,那我会告诉你“不好找” 其实好不好找工作,是跟自己的能力分不开的.但是就前端开发这个行业本身来说,它的就业前景还是相当不错的. 随着 ...
- MES系统与喷涂设备软件基于文本文件的数据对接方案
产品在生产过程中除了记录产品本身的一些数据信息,往往还需要记录下生产设备的一些参数和状态,这也是MES系统的一个重要功能.客户的药物支架产品,需要用到微量药物喷涂设备,客户需要MES系统能完整记录下每 ...
- 关于bat批处理的一些操作,如启动jar 关闭进程等
先说一下学习这个的前提: 公司要写个生成uid的工具,整完了之后就又整批处理工具,出于此目的,也是为了丰富自己的知识,就学习了一下,下面是相关的批处理脚本 我花了半天的时间找了相关的bat批处理,但是 ...
- python笔记-dumps()与loads()的使用
json.dumps是将一个Python数据类型列表进行json格式的编码解析, 示例如下: >>> import json #导入python 中的json模块 >>& ...
- 喵的Unity游戏开发之路 - 互动环境(有影响的运动)
如图片.视频或代码格式等显示异常,请查看原文: https://mp.weixin.qq.com/s/Sv0FOxZCAHHUQPjT8rUeNw 很多童鞋没有系统的Unity3D游戏开发基础,也不知 ...
- 【pytest】(三) pytest运行多个文件
1.运行多个测试文件 pytest 会运行 test_ 开头 或者 _test 结尾的文件,在当前目录和子目录中 2. 一个类下的多个用例的运行, pytest会找到 test_ 开头的方法 impo ...