Giter VIP home page Giter VIP logo

blogfe's Introduction

基于React的个人博客之前端

这是一个前后端分离的博客系统,还在完善中,目前实现了前端页面的文章渲染、详情、评论、管理员登录、创建文章、编辑文章等接口和界面交互 有需要的话可以根据以下步骤运行测试(建议配合当前系列的后端项目)

依赖环境

mac10.12.6、node7.6.0

步骤(这里介绍的是配合后端项目一起)

  1. npm i安装依赖
  2. npm start 这时候启动的是localhost:3000
  1. npm i
  2. npm start 会提示你端口号被占用
  3. 选择y即可
  4. 然后启动的是localhost:3001服务

正常的话前后端项目都会在本地运行起来,为了让让前端3001端口号访问后端3000端口上的接口可通过以下方式:

  1. 设置本地host,随机选一个域名指向你的本地如: 127.0.0.1 www.ichard.cn
  2. 开启nginx并在server里面加上以下设置
  3. reload nginx让nginx生效
    server {
        listen 8080;
        charset utf-8;
        server_name www.ichard.cn;
        root /;
        index index.html;
        location ~* \.(js|jpg|css|html|png|svg|json|ico)$ {
            proxy_pass http://127.0.0.1:3001;
        }
        location / {
            proxy_set_header Host $http_host;
            proxy_pass http://127.0.0.1:3001;
        }
        location /api/ {
            proxy_pass http://127.0.0.1:3000;
        }
    }

blogfe's People

Contributors

ichard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.