Skip to content

acr-lfr/generate-it-typescript-server-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

generate-it-typescript-server-client

Server client for typescript server

By default the http lib uses got - but this lib can be changed to anything you need it to be.

Description

These nunjucks templates are designed to build an api client for a typscript server.

The client is automatically built using the openapi-nodegen npm package: https://www.npmjs.com/package/openapi-nodegen

By default the http lib will pull config.baseUrl as the base url for all requests. You can override 'baseUrl' this with a -$ CLIENT_CONFIG_BASE_URL=

Example:

"scripts": {

"generate:nodegen:tsclient": "generate-it ./api_1.0.0.yml -o ./src/services/client -t https://github.com/acr-lfr/generate-it-typescript-server-client.git",

Override the baseUrl config path with something more specific to your api:

"scripts": {

"generate:nodegen:tsclient": "generate-it ./api_1.0.0.yml -o ./src/services/client -t https://github.com/acr-lfr/generate-it-typescript-server-client.git -$ CLIENT_CONFIG_SERVER_NAME=imageServer",

Notes

  • The generated HttpService (located inside the lib folder) by default will try to import the config object from the root folder of the generated client. Feel free to change it according to where you would like it to read your app's configuration from.

About

Server client for typescript server

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors