Node js TypeScript Fastify EP 02 Thunder client
In this episode, you will learn how to test your API using Thunder Client.
What is Thunder Client?
Thunder Client is a tool for testing APIs. It works inside Visual Studio Code. You can use it to send requests to your API and see the responses.
Step 1 - Install Thunder Client
Open Visual Studio Code. Go to the Extensions section. Search for "Thunder Client" and install it.
Step 2 - How to use Thunder Client
After installing Thunder Client, you will see a new icon in your sidebar. Click on it to open Thunder Client. You can create requests and test your API there.
Your complete index.ts file
After following all the steps in EP 01, your index.ts file should look like this:
import fastify from "fastify";
const app = fastify({
logger: true
})
app.get("/", async () => "SERVER");
const PORT = 5000
app.listen({port:Number(PORT)}, (err) => {
if (err) {
app.log.error(err);
process.exit(1)
}
app.log.info(`SERVE ON ${PORT}`)
})Originally published by me at the dev to - Akkarapon Phikulsri on DEV Community.





