Git Product home page Git Product logo

fblog's Introduction

FBlog

技术构成

快速开始

  1. 准备条件

安装 Node.js (v8 以上版本)、MongoDB
推荐安装 Yarn 而非 npm 以进行包管理。

  1. 安装依赖
$ yarn
  1. 启动站点
  • 开发模式
$ yarn run dev
  • 生产模式

先编译项目

$ yarn run build

再启动站点

$ yarn start

打开浏览器,访问 http://localhost:9000/

Enjoy it! 😄

系统设置

根据实际情况修改 /blog.config.ts 配置文件,修改后需要重启服务器才能生效。
参数说明:

host

String 类型,主机名,配置为 0.0.0.0 表示监听任意主机。

port

Number 类型,端口号。

enableHTTPS

Boolean 类型,是否启用 HTTPS。

mongoUrl

String 类型,MongoDB 链接。

jwtSecret

String 类型,JWT 秘钥。

线上部署

使用PM2

推荐使用 pm2 进行 Node.js 的进程管理和持久运行。

安装

$ yarn global add pm2

启动

$ pm2 start pm2.json

使用noginx

noginx 是基于 Node.js 的 HTTP 及反向代理服务器(类似 nginx),如果你有多台 iBlog 服务器实例,你可以使用 noginx 进行代理转发和负载均衡。

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.