Contents

New Client Generator

Generate local client library for APIs created with the RESTUtils Host utility with one command.

Contents

The first version of the RESTUtils Client is officially in NPM! The RESTUtils Host makes it so easy to generate APIs with one command that it’s only fitting to generate the appropriate API clients also with one command.

No installation is neccessary. From within your application simply tell the RESTUtils Client where your APIs are hosted: It’s another one-liner to generate everything you need:

1
2
3
npx restutils-client --host http://localhost:3001 \
                     --host http://localhost:3002 \
                     --host http://localhost:3003

Of course, it’s probably better to give your generated API clients names:

1
2
3
npx restutils-client --host http://localhost:3001 --name mailboxes \
                     --host http://localhost:3002 --name processing \
                     --host http://localhost:3003 --name storage-mobile

… so you can reference them easier:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
const apis = require('./apis/client');

const main = async () => {

  const testData = {
    ...
  };

  const result = await apis.storageMobile.messages.storeIncoming(testData);

  console.log('result:', result);

}

main();

Should you run into any snags, or have questions, feel free to reach out: info@restutils.com

Until then, have a great day!

Thanx,
Fred