0.0.14 • Published 8 years ago

replace-api-path v0.0.14

Weekly downloads
5
License
ISC
Repository
github
Last release
8 years ago

replace-api-path

开始使用

  1. 添加依赖 npm i replace-api-path --save-dev
  2. 添加./node_modules/.bin/replace-path到faas命令

参数

./node_modules/.bin/replace-path s=source-path d=dist-path

s url-map文件的路径 可选 默认为 '/config/urls.js'

d shell脚本生成目录 可选 默认为 '/dist'

url-map格式

const URL_MAP = {
  alpha: {
    SSO: 'alpha-sso',
    API_PREFIX: 'alpha-httpizza'
  },
  beta: {
    SSO: 'beta-sso',
    API_PREFIX: 'beta-httpizza'
  },
  prod: {
    SSO: 'prod-sso',
    API_PREFIX: 'prod-httpizza'
  }
}
const CURRENT_ENV = 'alpha'
const SSO = URL_MAP[CURRENT_ENV].SSO
const API_PREFIX = URL_MAP[CURRENT_ENV].API_PREFIX
const prodReplace = [
  {
    from: 'a.com',
    to: 'b.com',
    type: 'html'
  },
  {
    from: 'e.com',
    to: 'f.com',
    type: 'html'
  }
]
const testReplace = [
  {
    from: 'c.com',
    to: 'd.com',
    type: 'html'
  },
  {
    from: 'g.com',
    to: 'h.com',
    type: 'js'
  }
]

module.exports = { SSO, API_PREFIX, URL_MAP, prodReplace, testReplace }

URL_MAP中的prod对应的是production环境,其余的对应faas的测试环境

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago