NestJS+Vue开发流媒体网站(1)

开发环境配置

安装Node

参考https://www.jianshu.com/p/61119e7a2793

安装Vue

npm install -g @vue/cli
# OR
yarn global add @vue/cli

初始化项目

项目主目录

mkdir edu && cd_

前端项目初始化

vue create web
格式化问题

Prettier+ESLint开发Vue项目格式化问题:https://www.jianshu.com/p/41132df6d34b

添加elementui依赖
vue add element
添加axios依赖
安装axios
npm install axios --save
引入axios

main.js

import axios from 'axios'
Vue.prototype.$http = axios.create({
  baseURL:'http://localhost:3000'
})

3000为后端项目地址

axios用法

axios使用post和get发起请求:https://www.jianshu.com/p/56eae2a780b1

后端项目初始化

后端采用Nestjs开发

NestJs介绍
github地址

https://github.com/nestjs/nest

英文文档

https://docs.nestjs.com/

中文文档

https://docs.nestjs.cn/

周边资源

https://docs.nestjs.cn/6/awesome

安装nest-cli
npm install -g @nestjs/cli
创建后端项目
nest new server
安装依赖
nestjsx-crud

https://github.com/nestjsx/crud/wiki/ServiceTypeorm

#typeorm
yarn add @nestjsx/crud-typeorm @nestjs/typeorm typeorm
yarn add @nestjsx/crud class-transformer class-validator

# 连接mysql
yarn add mysql

#登录验证
yarn add @nestjs/passport passport passport-local
yarn add @types/passport-local --dev

#jwt
yarn add @nestjs/jwt passport-jwt
yarn add @types/passport-jwt --dev
swagger

https://github.com/nestjs/swagger

yarn add @nestjs/swagger swagger-ui-express
typeorm

https://typeorm.io/#/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容