1.0.0-beta.121 • Published 6 years ago

@axelspringer/mango-api v1.0.0-beta.121

Weekly downloads
5
License
MIT
Repository
-
Last release
6 years ago

:smiley_cat: Mango API

Taylor Swift Volkswagen TypeScript MIT license

Getting Started

requires a node version >= 6 and an npm version >= 3.x.x

we use Koa as middleware

we do provide a help command to display all possible arguments

# Installs the Mango API
npm i @axelspringer/mango-api -g

# Starts the Mango API in Mock modus
mango-api -d

Arguments

most command line arguments have a reflection in environment variables, which allows it to be easily tested and developed in many environments

help

Displays all the available arguments

-wp MANGO_WP (string)

Sets the url to the WordPress REST endpoint (e.g. http://localhost/wp-json/)

-m MANGO_MOCK (boolean)

Enables the Mocks of the Mango API.

-p MANGO_PORT (string)

Sets the port of the Mango API.

-h MANGO_HOST (string)

Sets the host of the Mango API.

-t MANGO_TOKEN (string)

Sets the X-MANGO-TOKEN to the value provided by WP Mango.

-s MANGO_SECRET (string)

Sets the X-MANGO-SECRET to the value provided by WP Mango.

-a MANGO_MOCK_ADAPTER (string)

Uses a differen adapter for the mock data. This should implement and overload.

--plugin MANGO_PLUGINS (string)

Loads an installed plugin (e.g. mango-plugin-pagemanager). If used multiple times, it loads multiple plugins. MANGO_PLUGINS should be used as follows export MANGO_PLUGINS='pagemanager,navigation'.

const api = require('@axelspringer/mango-api');

function mocks(axios, config) {
  let adapter = new api.MockAdapter(axios, config);
  adapter.get(api.WP.Posts, require('./data/posts.json')).reply(200);
  adapter.get(api.WP.Users, require('./data/users.json')).reply(200);
  adapter.get(api.WP.NavLocations, require('./data/navLocations.json'), true).reply(200);
  adapter.get(api.WP.NavLocations + '/', require('./data/navLocations.json')).reply(200);
  adapter.get(api.WP.NavMenu, require('./data/navMenus.json')).reply(200);
  adapter.get(api.WP.NavItems, require('./data/navItems.json')).reply(200);
  adapter.get(api.WP.Settings, require('./data/settings.json')).reply(200);
}

exports.default = mocks

Development

all commands can be seen via npm run help

# Clone the repository
git clone https://github.com/axelspringer/mango

# enter directory
cd mango/packages/api

# Start the local dev server
npm start

# To use your local version for development of other mango parts, run
npm link

Have fun!

License

MIT

1.0.0-beta.121

6 years ago

1.0.0-beta.120

6 years ago

1.0.0-beta.119

6 years ago

1.1.0-9

6 years ago

1.1.0-8

6 years ago

1.1.0-7

6 years ago

1.1.0-6

6 years ago

1.1.0-5

6 years ago

1.1.0-4

6 years ago

1.1.0-3

6 years ago

1.1.0-2

6 years ago

1.1.0-1

6 years ago

1.1.0-0

6 years ago

1.0.0-beta.116

6 years ago

1.0.0-beta.115

6 years ago

1.0.0-beta.114

6 years ago

1.0.0-beta.113

6 years ago

1.0.0-beta.112

6 years ago

1.0.0-beta.111

6 years ago

1.0.0-beta.110

6 years ago

1.0.0-beta.109

6 years ago

1.0.0-beta.106

6 years ago

1.0.0-beta.105

6 years ago

1.0.0-beta.104

6 years ago

1.0.0-beta.103

6 years ago

1.0.0-beta.102

6 years ago

1.0.0-beta.101

6 years ago

1.0.0-beta.100

6 years ago

1.0.0-beta.99

6 years ago

1.0.0-beta.98

6 years ago

1.0.0-beta.97

6 years ago

1.0.0-beta.96

6 years ago

1.0.0-beta.95

6 years ago

1.0.0-beta.94

6 years ago

1.0.0-beta.91

6 years ago

1.0.0-beta.90

6 years ago

1.0.0-beta.89

6 years ago

1.0.0-beta.88

6 years ago

1.0.0-beta.87

6 years ago

1.0.0-beta.86

6 years ago

1.0.0-beta.85

6 years ago

1.0.0-beta.84

6 years ago

1.0.0-beta.83

6 years ago

1.0.0-beta.82

6 years ago

1.0.0-beta.81

6 years ago

1.0.0-beta.79

6 years ago

1.0.0-beta.78

6 years ago

1.0.0-beta.77

6 years ago

1.0.0-beta.76

6 years ago

1.0.0-beta.75

6 years ago

1.0.0-beta.74

6 years ago

1.0.0-beta.73

6 years ago

1.0.0-beta.72

6 years ago

1.0.0-beta.71

6 years ago

1.0.0-beta.70

6 years ago

1.0.0-beta.69

6 years ago

1.0.0-beta.68

6 years ago

1.0.0-beta.67

6 years ago

1.0.0-beta.66

6 years ago

1.0.0-beta.65

6 years ago

1.0.0-beta.64

6 years ago

1.0.0-beta.63

6 years ago

1.0.0-beta.62

6 years ago

1.0.0-beta.61

6 years ago

1.0.0-beta.60

6 years ago

1.0.0-beta.59

6 years ago

1.0.0-beta.58

6 years ago

1.0.0-beta.57

6 years ago

1.0.0-beta.56

6 years ago

1.0.0-beta.55

6 years ago

1.0.0-beta.54

6 years ago

1.0.0-beta.53

6 years ago

1.0.0-beta.52

6 years ago

1.0.0-beta.51

6 years ago

1.0.0-beta.50

6 years ago

1.0.0-beta.49

6 years ago

1.0.0-beta.48

6 years ago

1.0.0-beta.47

6 years ago

1.0.0-beta.46

6 years ago

1.0.0-beta.45

6 years ago

1.0.0-beta.44

6 years ago

1.0.0-beta.43

6 years ago

1.0.0-beta.42

6 years ago

1.0.0-beta.41

6 years ago

1.0.0-beta.40

6 years ago

1.0.0-beta.39

6 years ago

1.0.0-beta.38

6 years ago

1.0.0-beta.37

6 years ago

1.0.0-beta.36

6 years ago

1.0.0-beta.35

6 years ago

1.0.0-beta.34

6 years ago

1.0.0-beta.33

6 years ago

1.0.0-beta.32

6 years ago

1.0.0-beta.31

6 years ago

1.0.0-beta.30

6 years ago

1.0.0-beta.29

6 years ago

1.0.0-beta.28

6 years ago

1.0.0-beta.27

6 years ago

1.0.0-beta.26

6 years ago

1.0.0-beta.25

6 years ago

1.0.0-beta.24

6 years ago

1.0.0-beta.23

6 years ago

1.0.0-beta.22

6 years ago

1.0.0-beta.21

6 years ago

1.0.0-beta.20

6 years ago

1.0.0-beta.19

6 years ago

1.0.0-beta.18

6 years ago

1.0.0-beta.17

6 years ago

1.0.0-beta.16

6 years ago

1.0.0-beta.15

6 years ago

1.0.0-beta.14

6 years ago

1.0.0-beta.13

6 years ago

1.0.0-beta.12

6 years ago

1.0.0-beta.11

6 years ago

1.0.0-beta.10

6 years ago

1.0.0-beta.9

6 years ago

1.0.0-beta.8

6 years ago

1.0.0-beta.7

6 years ago

1.0.0-beta.6

6 years ago

1.0.0-beta.5

6 years ago

1.0.0-beta.4

6 years ago

1.0.0-beta.3

6 years ago

1.0.0-beta.2

6 years ago

1.0.0-beta.1

6 years ago

1.0.0-beta.0

6 years ago

1.0.0-alpha.65

7 years ago

1.0.0-alpha.64

7 years ago

1.0.0-alpha.63

7 years ago

1.0.0-alpha.62

7 years ago

1.0.0-alpha.61

7 years ago

1.0.0-alpha.60

7 years ago

1.0.0-alpha.59

7 years ago

1.0.0-alpha.58

7 years ago

1.0.0-alpha.57

7 years ago

1.0.0-alpha.56

7 years ago

1.0.0-alpha.55

7 years ago

1.0.0-alpha.54

7 years ago

1.0.0-alpha.53

7 years ago

1.0.0-alpha.52

7 years ago

1.0.0-alpha.51

7 years ago

1.0.0-alpha.50

7 years ago

1.0.0-alpha.49

7 years ago

1.0.0-alpha.48

7 years ago

1.0.0-alpha.47

7 years ago

1.0.0-alpha.46

7 years ago

1.0.0-alpha.45

7 years ago

1.0.0-alpha.44

7 years ago

1.0.0-alpha.43

7 years ago

1.0.0-alpha.42

7 years ago

1.0.0-alpha.41

7 years ago

1.0.0-alpha.40

7 years ago

1.0.0-alpha.39

7 years ago

1.0.0-alpha.38

7 years ago

1.0.0-alpha.37

7 years ago

1.0.0-alpha.36

7 years ago

1.0.0-alpha.35

7 years ago

1.0.0-alpha.34

7 years ago

1.0.0-alpha.33

7 years ago

1.0.0-alpha.32

7 years ago

1.0.0-alpha.31

7 years ago

1.0.0-alpha.30

7 years ago

1.0.0-alpha.29

7 years ago

1.0.0-alpha.28

7 years ago

1.0.0-alpha.27

7 years ago

1.0.0-alpha.26

7 years ago

1.0.0-alpha.25

7 years ago

1.0.0-alpha.24

7 years ago

1.0.0-alpha.23

7 years ago

1.0.0-alpha.22

7 years ago

1.0.0-alpha.21

7 years ago

1.0.0-alpha.20

7 years ago

1.0.0-alpha.19

7 years ago

1.0.0-alpha.18

7 years ago

1.0.0-alpha.17

7 years ago

1.0.0-alpha.16

7 years ago

1.0.0-alpha.15

7 years ago

1.0.0-alpha.14

7 years ago

1.0.0-alpha.13

7 years ago

1.0.0-alpha.12

7 years ago

1.0.0-alpha.11

7 years ago

1.0.0-alpha.10

7 years ago

1.0.0-alpha.9

7 years ago

1.0.0-alpha.8

7 years ago

1.0.0-alpha.7

7 years ago

1.0.0-alpha.6

7 years ago

1.0.0-alpha.5

7 years ago

1.0.0-alpha.4

7 years ago

1.0.0-alpha.3

7 years ago

1.0.0-alpha.2

7 years ago

1.0.0-alpha.1

7 years ago

1.0.0-alpha.0

7 years ago

0.12.3

7 years ago

0.12.2

7 years ago

0.12.1

7 years ago

0.12.0

7 years ago

0.6.9

7 years ago

0.11.7

7 years ago

0.11.6

7 years ago

0.11.5

7 years ago

0.11.4

7 years ago

0.11.3

7 years ago

0.11.2

7 years ago

0.11.1

7 years ago

0.10.5

7 years ago

0.10.4

7 years ago

0.10.3

7 years ago

0.10.2

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.0

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.7.0

7 years ago

0.6.8

7 years ago

0.6.7

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.10

7 years ago

0.5.9

7 years ago

0.5.8

7 years ago

0.5.7

7 years ago

0.5.6

7 years ago

0.5.5

7 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.1.21

7 years ago

0.1.20

7 years ago

0.1.17

7 years ago

0.1.16

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.4-alpha

7 years ago

0.0.3-alpha

7 years ago

0.0.2-alpha

7 years ago

0.0.1-alpha

7 years ago