Giter VIP home page Giter VIP logo

node-airx-webapp's Introduction

node-airx-webapp

一个基于AirX OpenAPI & SDK的演示应用

Table of Contents generated with DocToc

说明

该项目只采用了前后端分离的设计理念.

后端接口采用@airx/sdk来完成AirX Open API的反向代理.

前端请求参数

签名相关参数

签名相关参数不用通过前端传递,防止AK/SK的泄露,签名交给Node.js后端反代应用程序处理,所以以下几个签名相关参数不用传递:

  • Nonce
  • SecretId
  • Signature
  • SignatureMethod
  • Timestamp

登录Auth Token

由于反代应用程序支持 Cookie Session, 所以前端不用存储 Auth Token,也免去了 Auth Token被截获的风险.所以如果接口需要以下参数,不用传递:

  • auth

登录设备相关参数

每个会话都会生成一个随机唯一的模拟登录设备id, 如果接口需要以下参数, 不用传递:

  • guid
  • device

项目目录结构

  • server/ 服务器后端源码目录
  • app/ 前端应用源码目录
  • dist/ 前端应用通过webpack等工具进行打包压缩, 将静态文件存放的目录

建议的 dist 目录结构

  • index.html
  • 404.html 和 403,500... 等其他相关错误的html
  • static/ 文件目录,或分类目录存放 css/js/图片等静态资源

运行

服务器参考配置位于 server/config/_sample.js, 本地开发需要新建一个 _development.js

调试运行后端应用:

DEBUG=@airx/sdk node server/index.js

默认端口为3456,可以自行修改.

LICENSE

Apache 2.0

node-airx-webapp's People

Contributors

solocao avatar willin avatar

Stargazers

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