Code Monkey home page Code Monkey logo

shop's Introduction

shop

使用nodejs和react做的H5商店,开发中。需配置自己的七牛key,云片key(不要用我的)。预览地址https://192.243.114.175

Image of Yaktocat

配置步骤 1.下载

git clone https://github.com/CaiLifeng/shop.git

2.配置client端,将会生成build文件夹。

cd client
npm install
npm run deploy

3.安装mongodb,新建collection shop,进入到server文件夹,运行命令

mongoimport -d shop -c areas < area.json

4.配置server端。

npm install
npm install pm2 -g
cd bin
pm2 start www.js

5.配置nginx代理,因为location api必须在https环境下才能使用。这里的证书需要自己生成,可以参考http://www.liaoxuefeng.com/article/0014189023237367e8d42829de24b6eaf893ca47df4fb5e000

server {
        listen       443 ssl;
        server_name  localhost;

	ssl_certificate    /etc/nginx/ssl/www.shsf4.com.crt;
	ssl_certificate_key  /etc/nginx/ssl/www.shsf4.com.key;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /root/shop/client/build;
            index  index.html index.htm home.html;
        }
        location /api/ {
            proxy_pass http://localhost:3000;
        }

        
        
        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

shop's People

Contributors

cailifeng avatar

Watchers

 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.