Leveraging OpenAPI to leverage the documentation and call the function instead of the URL. This also includes the format of the body, parameters, and return types for each endpoint.
Use the package manager node to install client-next.
cd client-next
npm install
# or
yarn install
Use the dependency manager composer for api
cd api
cp .env.example .env
composer install
php artisan key:gen
To generate the services from the backend. Run the command inside of client-next
folder
openapi-generator-cli generate -i http://localhost:8000/docs/api-docs.json -g typescript-fetch -o ./src/api
http://localhost:8000/docs/api-docs.json
: sets the URL of openAPI.typescript-fetch
: generate the docs using typescript fetch. Can be Axios or javascript-fetch../src/api
: sets the path and store the generated files.