Git Product home page Git Product logo

my-blog's Introduction

vue服务端渲染博客,基于nuxt

安装

 git clone [email protected]:Hzy0913/my-blog.git

安装包依赖

 npm install

运行

运行发开环境

npm run dev

本地访问http://localhost:3000

打包部署

tip:生产环境打包需要在服务端进行! 首先打包编译项目

npm run build

运行项目

npm run start

推荐生产环境使用如下命令执行pm2部署

推荐全局安装pm2

第一次部署使用firstserver命令

npm run firstserver

以后每次更新代码执行server命令

npm run server

暂停服务执行stop命令

npm run stop

查看服务状态执行list命令

npm run list

该命令会编译打包项目,然后启动一个pm2守护进程服务,具体可见package中的npm script

项目说明

  • 使用nuxt.js的vue服务端渲染ssr.
  • 使用element-ui 组件库.
  • 使用axios请求库
  • 使用github的Oauth授权登录,评论系统
  • 使用marked解析markdown文档
  • 使用highlight完成代码格式语法高亮

在线预览

See BinLive.

本地预览

想要在本地开发环境运行完整线上模式,可以转发调用binlive线上环境接口。 修改nuxt.config.js文件

// 将下面接口调用地址
proxy: [
  ['/api', { target: 'http://localhost:3080' }]
]
// 修该成binlive线上地址
proxy: [
  ['/api', { target: 'http://binlive.cn:3080' }]
]

修改plugins/axios.js文件

// 将下面接口调用地址
if (process.server) {
  options.baseURL = 'http://localhost:3080'
}
// 修该成binlive线上地址
if (process.server) {
  options.baseURL = 'http://binlive.cn:3080'
}

commit

由于spa对于seo不友好,重构了之前使用vue的spa形式的博客,使用nuxt.js

博客后端

博客的后端以及后台管理系统项目为博客后端项目。

my-blog's People

Contributors

hzy0913 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.