Socket
Book a DemoInstallSign in
Socket

@alicd/toffee-api

Package Overview
Dependencies
Maintainers
5
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alicd/toffee-api

api for toffee

latest
npmnpm
Version
0.0.1
Version published
Maintainers
5
Created
Source

@alife/toffee-api

import api from '@alife/toffee-api';
// 设置当前环境为mock,默认为pub
api.setMockEnv(); 
api.setPubEnv();

// 根据当前环境获取接口地址
api.get({ 
    url: 'xxxx',
    mockUrl: 'yyyy'
});

// 设置全局接口映射
api.setApiMap({
    getName: {
        pub: 'xxx',
        mock: 'yyy'
    },
    getAge: {
        pub: 'xxx',
        mock: 'yyy'
    }
});

// 根据当前环境获取接口地址
api.get('getName');

env

  • nodejs: 10.15.0

development

  • $ npm run start

build

  • $ npm run build

publish

refer to scripts/release.sh, somtimes you need to modify it.

Keywords

Cone

FAQs

Package last updated on 13 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts