All Projects → FantasyGao → blog-backend

FantasyGao / blog-backend

Licence: other
前后端分离实践----基于Koa2框架博客后端

Programming Languages

javascript
184084 projects - #8 most used programming language
Nginx
273 projects

Projects that are alternatives of or similar to blog-backend

Graphql Demo
🎉Koa + GraphQL + Apollo-Server demo
Stars: ✭ 215 (+298.15%)
Mutual labels:  koa, mongoose
koa-session-mongoose
Mongoose store for Koa sessions
Stars: ✭ 29 (-46.3%)
Mutual labels:  koa, mongoose
koa-mongoDB
😊😊Koa and mongoose build services
Stars: ✭ 24 (-55.56%)
Mutual labels:  koa, mongoose
Lad
👦 Lad is the best Node.js framework. Made by a former Express TC and Koa team member.
Stars: ✭ 2,112 (+3811.11%)
Mutual labels:  koa, mongoose
node-server
(@nestjs refactoring)⚡️My personal website's api server, a RESTful application that powered by @eggjs
Stars: ✭ 17 (-68.52%)
Mutual labels:  mongoose, jsonwebtoken
Blog Service
blog service @nestjs
Stars: ✭ 188 (+248.15%)
Mutual labels:  koa, mongoose
node-simple-jwt
No description or website provided.
Stars: ✭ 19 (-64.81%)
Mutual labels:  mongoose, jsonwebtoken
Fclub
Vue全家桶+Koa+mongoose全栈开发的单页应用 http://wap.fulun.club
Stars: ✭ 49 (-9.26%)
Mutual labels:  koa, mongoose
koa-server
🗄️ GraphQL Back-end Server with Relay, Koa, MongoDB and Mongoose
Stars: ✭ 31 (-42.59%)
Mutual labels:  koa, mongoose
node-fs
node-fs
Stars: ✭ 55 (+1.85%)
Mutual labels:  koa, mongoose
Koa Vue Fullstack
A lightweight boilerplate for a universal webapp based on koa, mongodb, node, vue, and webpack
Stars: ✭ 126 (+133.33%)
Mutual labels:  koa, mongoose
express-mongoose-es8-rest-api
A Boilerplate for developing Rest api's in Node.js using express with support for ES6,ES7,ES8 ,Mongoose,JWT for authentication,Standardjs for linting
Stars: ✭ 20 (-62.96%)
Mutual labels:  mongoose, jsonwebtoken
Vue Family Bucket Ssr Koa2 Full Stack Development From Meituan
🚀🚀2020最新Vue全家桶+SSR+Koa2全栈开发☁
Stars: ✭ 100 (+85.19%)
Mutual labels:  koa, mongoose
Nobibi
一款基于Next.js+mongo的轻量级开源社区(open community by Next.js & mongo)
Stars: ✭ 209 (+287.04%)
Mutual labels:  koa, mongoose
Cdfang Spider
📊 成都房协网数据分析,喜欢请点 star!
Stars: ✭ 1,063 (+1868.52%)
Mutual labels:  koa, mongoose
vue-koa2-login
🍥 Vue + Koa2 实现前后端注册登录流程
Stars: ✭ 23 (-57.41%)
Mutual labels:  koa, jsonwebtoken
X Restful Api Generator Koa
一个基于 Koa 的 RESTful API 服务脚手架。 A RESTful API generator for Koa
Stars: ✭ 18 (-66.67%)
Mutual labels:  koa, jsonwebtoken
Timeline Vue
💌基于 Vue -> Koa2 -> Mongoose 的留言时间轴,记录美好时光。
Stars: ✭ 14 (-74.07%)
Mutual labels:  koa, mongoose
react-graphql
react-graphql 快速开发方案
Stars: ✭ 15 (-72.22%)
Mutual labels:  koa, mongoose
login push
vue+koa2+jwt实现单点登录 + todolist增删改查
Stars: ✭ 20 (-62.96%)
Mutual labels:  mongoose, jsonwebtoken

前后端分离实践----blog's backend

前端地址---- blog's frontend

简介:通过vue.js框架与koa2框架分别搭建前后端,利用ngnix端口分发部署实现代码全分离,开发全分离。

nginx文件配置内容

   server {
   	listen       80;
   	server_name  localhost;
   	location / {
   	    proxy_pass http://127.0.0.1:8080;               #转发非api,与上传的静态资源的其他信息 
   	    proxy_redirect default;
   	}
   	location /api/ {
   	    proxy_pass http://127.0.0.1:3000/api/;          #转发至api接口
   	}
   		location ^~ /uploads/ {
   	    proxy_pass http://127.0.0.1:3000/uploads/;     #转发至上传的静态资源
   	}
   }

Getting Start

1. 开发环境
node.js 7.6+
mognodb 3.0+
2. 依赖于mongodb数据库

      先安装 mongodb 数据库,安装完成后运行数据库,开启27017(默认)端口

3. 克隆到本地,安装依赖,运行
> git clone https://github.com/FantasyGao/blog-backend.git
> cd blog-backend
> npm install 
> npm start

简要概述

1. 全部使用ES6语法,aysnc+await结构

2. 通过mongoose模块+promise模块操作mongodb数据库

3. 由jsonwebtoken模块完成权限控制

4. (可选)koa-sslify 模块,实现https,需要ssl证书和密钥

5. koa-multer模块协助完成静态文件上传

目录结构

➜  backend
.
├── README.md
├── app.js
├── node_modules
├── package.json
├── public
│   ├── images
│   ├── dist
│   └── upoloads
├── ssl
│   ├── server.cert
│   └── server.key
├── db
│   ├── config.js
│   └── model.js
├── api
│   ├── articleAPI.js
├── ├── userAPI.js
│   └── logAPI.js
├── route
│   ├── api.js
├── ├── auth.js
│   └── other.js
└── views
    ├── err.ejs
    └── index.ejs

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].