Creating a Microservice
Using a coding agent is the best way of working with microservices, including the creation of new ones.
Using a Coding Agent
Step 1: Initialize the Coding Agent
Start your coding agent, e.g.:
claudeStep 2: Create a New Microservice
Use a prompt similar to the following to create a new microservice.
Create a new “stripe” microservice that will process credit card payments via Stripe. Place it under the @financial/ directory. Set its hostname to “stripe.financial.ex”.
Step 3: Implement the Business Logic
Use prompts such as the following to add one feature at a time to the microservice:
Add a config property that will hold the Stripe API key. Make it secret.
Create a functional endpoint “CreateIntent” that accepts a credit card number, email, and a dollar amount as arguments, and calls the Stripe API to create an intent. If successful, it should return the transaction ID.