一个比较小的移动端web博客demo,虽然功能简单,但涉及到的知识点还是比较多的: 如:node、express、mongodb、vue2.x、vue-router、muse-ui、rem布局、移动web等等。 需先按照mongodb、node环境
首先需要安装好node环境、mongodb数据库,安装好后继续以下步骤:
# 打开命令行窗口,启动mongodb,mac的方法为:
输入sudo mongod指令,输入密码后回车
# 新建命令行窗口,启动server端,成功后运行的端口为8888,方法为:
cd server
node index.js
然后按照vue项目常规步骤:
# 新建命令行窗口,安装依赖
npm install
# 开发环境运行,随后可打开http://localhost:8080浏览
npm run dev
# 生产环境,build后可打开http://localhost:8888浏览
npm run build
# build for production and view the bundle analyzer report
npm run build --report
For a detailed explanation on how things work, check out the guide and docs for vue-loader.