<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mrigank Sachan on Medium]]></title>
        <description><![CDATA[Stories by Mrigank Sachan on Medium]]></description>
        <link>https://medium.com/@sachanyash123?source=rss-d422ef620709------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sZflU1NftYbJhqqcS6VWnw.jpeg</url>
            <title>Stories by Mrigank Sachan on Medium</title>
            <link>https://medium.com/@sachanyash123?source=rss-d422ef620709------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 20:38:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sachanyash123/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kong API Gateway: The Comprehensive Guide for Modern Microservices]]></title>
            <link>https://medium.com/@sachanyash123/kong-api-gateway-the-comprehensive-guide-for-modern-microservices-fd0da691091b?source=rss-d422ef620709------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd0da691091b</guid>
            <category><![CDATA[kong-api-gateway]]></category>
            <category><![CDATA[kong]]></category>
            <category><![CDATA[api-gateway]]></category>
            <dc:creator><![CDATA[Mrigank Sachan]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 11:13:40 GMT</pubDate>
            <atom:updated>2026-04-15T11:26:37.921Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Master the central hub of modern architecture with this deep dive into performance, scalability, and the new era of AI-ready gateways.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vXHebm2O2BhW0ev_A8R1Kg.jpeg" /></figure><p><em>The Gateway Hub: Orchestrating chaotic traffic into organized streams.</em></p><p>In the world of modern software architecture, microservices are the standard. But as your ecosystem grows, so does the complexity of managing communication. When you have dozens — or hundreds — of independent services, managing individual endpoints becomes a security and scalability nightmare.</p><p>This is where the <strong>API Gateway</strong> comes in.</p><p><strong>What is an API Gateway?</strong></p><p>At its core, an API Gateway acts as a reverse proxy and the single entry point for all client requests. It effectively decouples your client-facing interface from your internal microservice landscape.</p><p>Instead of clients talking to every service directly, they talk to the Gateway. It then:</p><p><strong>Routes</strong> requests to the appropriate backend services.</p><p><strong>Centralizes</strong> cross-cutting concerns like authentication, rate limiting, and logging.</p><p><strong>Prevents</strong> messy logic duplication across your service mesh.</p><h3>Introducing Kong: The Gold Standard</h3><p><strong>Kong API Gateway</strong> is an open-source, cloud-native API management layer built for high performance. Originally developed by Mashape, it has evolved into the industry standard for high-throughput environments.</p><p>Built on top of <strong>Nginx</strong> and <strong>OpenResty</strong>, Kong is designed for sub-millisecond latency. Whether you’re running on bare metal, Docker, or Kubernetes, Kong scales effortlessly from a few local services to a global multi-cloud enterprise.</p><p><strong>Why choose Kong?</strong></p><p><strong>Performance:</strong> Lightweight and fast, capable of handling massive traffic spikes.</p><p><strong>Extensibility:</strong> A massive plugin ecosystem for almost any use case.</p><p><strong>AI Ready:</strong> The latest 3.x releases include a specialized “AI Proxy” for LLM orchestration (OpenAI, Gemini, etc.).</p><p><strong>Deployment Flexiblity:</strong> Offers both a Free OSS Community Edition and a robust Enterprise tier (Konnect).</p><p><strong>Core Concepts &amp; Architecture</strong></p><p>To master Kong, you need to understand its four foundational building blocks:</p><p>1. <strong>Services:</strong> A representation of your backend API or upstream microservice.</p><p>2. <strong>Routes:</strong> The rules that define how traffic reaches a Service (e.g., path-based routing like `/orders` or `/users`).</p><p>3. <strong>Consumers:</strong> Representations of users or applications, allowing you to track and restrict access per-user.</p><p>4. <strong>Plugins:</strong> Modular logic units that you “stack” onto Services or Routes to add functionality like Auth or Caching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKu4gkbADe0mK1p4ofZI9Q.jpeg" /></figure><p><em>The modular chain: Auth, Rate Limiting, and Security layers.</em></p><p><strong>The “Brain” and the “Brawn”: Control vs. Data Plane</strong></p><p>Kong operates on a decoupled architecture:</p><p><strong>Control Plane (CP):</strong> The administrative “brain” where you define rules and configurations via Admin APIs or Kong Konnect.</p><p><strong>Data Plane (DP):</strong> The “worker” nodes that handle the actual network traffic and execute the rules.</p><p>&gt; <strong>Pro Tip: DB-less Mode</strong></p><p>&gt; For GitOps workflows, Kong can run in “DB-less” mode. It loads all configuration from a single declarative YAML file into memory, ensuring zero database latency and immutable deployments.</p><p><strong>Engineered for Excellence: Key Features</strong></p><p><strong>1. Traffic Control &amp; Security</strong></p><p>Standardize your security posture instantly. Instead of coding authentication into every microservice, let Kong handle:</p><p><strong>Auth:</strong> Basic Auth, API Keys, OAuth 2.0, OIDC, and JWT.</p><p><strong>Traffic:</strong> Advanced load balancing, proxy caching, and millisecond-accurate rate limiting.</p><p><strong>Protection:</strong> Bot detection, IP restriction, and Mutual TLS (mTLS).</p><p><strong>2. Observability</strong></p><p>Stop flying blind. Kong integrates seamlessly with Prometheus, Datadog, and Splunk. With native OpenTelemetry support, you get full visibility into metrics, logs, and distributed traces.</p><p><strong>3. AI Connectivity (The Future)</strong></p><p>Kong’s new AI Proxy plugin standardizes signatures for major LLM providers (OpenAI, Anthropic, Gemini). This allows you to monitor token consumption and control costs at the gateway level before the request even hits the model.</p><p><strong>Implementation Guide: From Theory to Practice</strong></p><p>Kong uses declarative configuration. Here is how you define a service and a route in a `kong.yml` file:</p><pre>_format_version: &quot;3.0&quot;<br>_transform: true<br>services:<br>- name: example-service<br>url: http://httpbin.org/get<br>routes:<br>- name: example-route<br>paths:<br>- /echo<br>strip_path: true</pre><p>Adding Security</p><p>Want to add an API Key requirement? Just add a plugin to your service:</p><pre>services:<br>- name: example-service<br>plugins:<br>- name: key-auth<br>config:<br>key_names: [apikey]<br>consumers:<br>- username: dev-user<br>keyauth_credentials:<br>- key: top-secret-key-123</pre><p>Testing your endpoint</p><p>Once configured, you can verify your gateway with a simple curl command:</p><pre>curl -i -X GET http://localhost:8000/echo \<br>-H &quot;apikey: top-secret-key-123&quot;</pre><p><strong>Technical Demonstrations: Automation</strong></p><p>For developers looking to automate their infrastructure, Kong’s Admin API is incredibly powerful. Here is a conceptual look at managing Kong via Python:</p><p><strong>Service Management</strong></p><pre>class KongManager:<br>def create_service(self, name, url):<br>Logic to POST to Kong Admin API<br>payload = {&quot;name&quot;: name, &quot;url&quot;: url}<br>print(f&quot;Creating Service: {name}…&quot;)<br>return {&quot;id&quot;: &quot;svc-123&quot;, &quot;status&quot;: &quot;created&quot;}<br>manager = KongManager()<br>manager.create_service(&quot;order-api&quot;, &quot;http://internal-orders.local&quot;)</pre><p><strong>Enabling Rate Limiting</strong></p><pre>def enable_rate_limiting(service_name, minute_limit):<br>Logic to apply the plugin via API<br>print(f&quot;Enabling {minute_limit} req/min limit on {service_name}&quot;)<br>return {&quot;enabled&quot;: True, &quot;limit&quot;: minute_limit}<br>enable_rate_limiting(&quot;order-api&quot;, 5)</pre><p><strong>Conclusion</strong>: The Keystone of Modern Infrastructure</p><p>An API Gateway is no longer a luxury; it is a requirement for any serious distributed system. Kong offers the perfect blend of performance, simplicity, and future-proof extensibility.</p><p>By abstracting away the “plumbing” — authentication, routing, and AI connectivity — Kong allows your team to focus on what actually matters: building great products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*clBoFGDh4yqwkhMuLSNLqg.jpeg" /></figure><p>Ready to Scale?</p><p>Whether you’re a startup or a global enterprise, the journey to a managed infrastructure starts with a single gateway.</p><p>Next Steps:</p><p>Check out <a href="https://konghq.com/">Kong Konnect</a> for a managed control plane.</p><p>Explore the <a href="https://docs.konghq.com/hub/">Kong Plugin Hub</a> to see what else you can automate.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd0da691091b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Guide to Kong API Gateway (Part 1): Setup and Core Concepts]]></title>
            <link>https://medium.com/@sachanyash123/the-ultimate-guide-to-kong-api-gateway-part-1-setup-and-core-concepts-ad5183ac53b7?source=rss-d422ef620709------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad5183ac53b7</guid>
            <category><![CDATA[request-transformer]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[kong-api-gateway]]></category>
            <category><![CDATA[kong]]></category>
            <dc:creator><![CDATA[Mrigank Sachan]]></dc:creator>
            <pubDate>Sun, 20 Jul 2025 11:10:53 GMT</pubDate>
            <atom:updated>2025-07-20T11:10:53.090Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2CsfTmGcr0ha95OXs5byw.png" /></figure><p>Welcome to the first part of our series on Kong, the open-source API gateway. In this installment, we’ll cover what Kong is, why you need an API gateway, and how to get a basic instance up and running.</p><h3>What is an API Gateway?</h3><p>In modern microservices architecture, you might have dozens or even hundreds of individual services. An API gateway acts as a single entry point for all client requests, routing them to the appropriate backend service. It’s a reverse proxy that sits in front of your APIs to handle cross-cutting concerns.</p><p>Think of it as a traffic cop for your API traffic. It manages, secures, and orchestrates requests and responses, allowing your backend services to focus purely on their business logic.</p><h3>Why Use Kong?</h3><p>Kong is a lightweight, fast, and flexible cloud-native API gateway. It’s built on top of a reliable foundation (NGINX) and is extensible through a rich ecosystem of plugins. Here are the core problems Kong helps solve:</p><ul><li>Authentication &amp; Authorization: Secure your services with plugins for JWT, OAuth2, Key Authentication, and more, without adding complex logic to each service.</li><li>Traffic Control: Implement rate limiting, request/response transformations, and caching to protect your APIs from abuse and improve performance.</li><li>Observability: Gain deep insights into your API traffic with logging and metrics integrations for platforms like Prometheus, Datadog, and Splunk.</li><li>Decoupling: Decouple clients from backend services. You can refactor, move, or add new services without impacting the client-side experience.</li></ul><h3>Setting Up Kong with Docker</h3><p>The quickest way to get started with Kong is by using Docker. We’ll use Docker Compose to set up Kong along with its required database (we’ll use PostgreSQL).</p><p>1. Create a Docker Compose file:</p><p>Create a file named docker-compose.yml and add the following configuration:</p><pre>version: &#39;3.8&#39;<br><br>services:<br>  kong-db:<br>    image: postgres:13<br>    container_name: kong-db<br>    environment:<br>      - POSTGRES_USER=kong<br>      - POSTGRES_DB=kong<br>      - POSTGRES_PASSWORD=kong<br>    ports:<br>      - &quot;5432:5432&quot;<br>    healthcheck:<br>      test: [&quot;CMD&quot;, &quot;pg_isready&quot;, &quot;-U&quot;, &quot;kong&quot;]<br>      interval: 5s<br>      timeout: 5s<br>      retries: 5<br><br>  kong-migrations:<br>    image: kong:latest<br>    container_name: kong-migrations<br>    depends_on:<br>      - kong-db<br>    environment:<br>      - KONG_DATABASE=postgres<br>      - KONG_PG_HOST=kong-db<br>      - KONG_PG_PASSWORD=kong<br>    command: &quot;kong migrations bootstrap&quot;<br><br>  kong-gateway:<br>    image: kong:latest<br>    container_name: kong-gateway<br>    depends_on:<br>      - kong-migrations<br>    environment:<br>      - KONG_DATABASE=postgres<br>      - KONG_PG_HOST=kong-db<br>      - KONG_PG_PASSWORD=kong<br>      - KONG_PROXY_ACCESS_LOG=/dev/stdout<br>      - KONG_ADMIN_ACCESS_LOG=/dev/stdout<br>      - KONG_PROXY_ERROR_LOG=/dev/stderr<br>      - KONG_ADMIN_ERROR_LOG=/dev/stderr<br>      - KONG_ADMIN_LISTEN=0.0.0.0:8001<br>    ports:<br>      - &quot;8000:8000&quot; # Proxy port<br>      - &quot;8001:8001&quot; # Admin API port</pre><p>2. Start Kong:</p><p>Open your terminal in the same directory as the file and run:</p><pre>docker-compose up -d</pre><p>This command will download the necessary images and start the Kong gateway and its database in the background. You can verify that Kong is running by sending a request to the Admin API:</p><pre>curl -i http://localhost:8001</pre><p>You should receive a HTTP/1.1 200 OK response with JSON data about the running Kong node.</p><h3>Configuring Your First API</h3><p>Now that Kong is running, let’s configure it to proxy requests to a backend service. We’ll use httpbin.org, a public testing service.</p><p>Kong’s core entities are Services and Routes.</p><ul><li>A Service is an entity representing an upstream backend API (e.g., your user management service).</li><li>A Route defines how requests are sent to a Service. A single Service can have many Routes (e.g., by path, host, or methods).</li></ul><p>1. Add a Service:</p><p>Use the Admin API to register httpbin.org as a new service named example-service.</p><pre>curl -i -X POST \<br>  --url http://localhost:8001/services/ \<br>  --data &#39;name=example-service&#39; \<br>  --data &#39;url=http://httpbin.org&#39;</pre><p>2. Add a Route to the Service:</p><p>Now, create a route that maps requests with the path /mock to the example-service we just created.</p><pre>curl -i -X POST \<br>  --url http://localhost:8001/services/example-service/routes \<br>  --data &#39;paths[]=/mock&#39; \<br>  --data &#39;name=mocking-route&#39;</pre><p>3. Test the Route:</p><p>You’re all set! Any request sent to Kong’s proxy port (8000) at the path /mock will now be forwarded to httpbin.org.</p><pre>curl -i http://localhost:8000/mock/get</pre><p>The response you get back will be from httpbin.org, but it was proxied through your local Kong instance.</p><p>Congratulations! You’ve successfully set up Kong and configured your first proxied API. In the next part of this series, we will explore Kong’s most powerful feature: Plugins.</p><h3>The Ultimate Guide to Kong API Gateway (Part 2): Powering Up with Plugins</h3><p>In Part 1, we set up a basic Kong instance. Now, we’ll dive into the heart of Kong’s power: plugins. Plugins allow you to solve real-world API management challenges like security, traffic control, and logging with minimal effort.</p><h3>What Are Kong Plugins?</h3><p>Plugins are modular pieces of code that hook into the request/response lifecycle within Kong. They can be configured to run globally (on all requests), or for specific Routes or Services. This allows for incredibly granular control over your API traffic.</p><p>Let’s explore how to use plugins to solve common problems.</p><h3>Problem 1: Securing an API</h3><p>Challenge: You have an internal service that should only be accessible to trusted clients. You don’t want to build authentication logic into the service itself.</p><p>Solution: The Key Authentication plugin. This plugin requires clients to provide an API key in their requests.</p><p>1. Enable the plugin on our service:</p><p>Let’s apply the key-auth plugin to the example-service we created in Part 1.</p><pre>curl -i -X POST \<br>  --url http://localhost:8001/services/example-service/plugins \<br>  --data &#39;name=key-auth&#39;</pre><p>2. Test the secured endpoint:</p><p>If you try to access the API now, Kong will block the request because you haven’t provided a key.</p><pre>curl -i http://localhost:8000/mock/get</pre><pre># You&#39;ll receive a 401 Unauthorized response<br># {&quot;message&quot;:&quot;No API key found in request&quot;}</pre><p>3. Create a Consumer and API Key:</p><p>In Kong, a Consumer represents a user or client of your API. Let’s create one.</p><pre>curl -i -X POST \<br>  --url http://localhost:8001/consumers/ \<br>  --data &quot;username=my-app&quot;</pre><p>Now, generate an API key for this consumer:</p><pre>curl -i -X POST \<br>  --url http://localhost:8001/consumers/my-app/key-auth/ \<br>  --data &#39;key=super-secret-key&#39;</pre><p>4. Access the API with the Key:</p><p>You can now access the API by providing the key in the apikey header.</p><pre>curl -i http://localhost:8000/mock/get \<br>  --header &#39;apikey: super-secret-key&#39;</pre><pre># Success! You&#39;ll get a 200 OK response.</pre><p>You’ve just secured your API without touching a single line of your backend service’s code.</p><h3>Problem 2: Preventing Abuse</h3><p>Challenge: A popular public API is getting overwhelmed with requests from a single user, degrading performance for everyone else.</p><p>Solution: The Rate Limiting plugin. This plugin lets you restrict how many requests a consumer can make in a given time period.</p><p>1. Enable the plugin:</p><p>Let’s add a rate limit of 5 requests per minute for authenticated users of our service.</p><pre>curl -i -X POST \<br>  --url http://localhost:8001/services/example-service/plugins \<br>  --data &quot;name=rate-limiting&quot; \<br>  --data &quot;config.minute=5&quot; \<br>  --data &quot;config.policy=local&quot;</pre><p>2. Test the Rate Limit:</p><p>Make six requests in quick succession using the API key from before.</p><pre>for i in {1..6}; do<br>  curl -i http://localhost:8000/mock/get -H &#39;apikey: super-secret-key&#39;<br>done</pre><p>The first five requests will succeed with a 200 OK. The sixth request will be rejected with a 429 Too Many Requests response.</p><h3>Other Powerful Plugins</h3><p>Kong has a vast library of plugins to solve many other issues:</p><ul><li>OAuth2 Introspection: Integrate with an OAuth2 provider to validate access tokens.</li><li>JWT: Secure your APIs using JSON Web Tokens.</li><li>Request Transformer: Modify the request before it hits your upstream service (e.g., add or remove headers).</li><li>Response Transformer: Modify the response before it’s sent back to the client.</li><li>Logging Plugins: Send detailed request/response logs to systems like TCP, UDP, file, or external platforms like Datadog.</li></ul><p>Plugins are the key to unlocking Kong’s full potential. In the final part of our series, we’ll learn how to monitor Kong to ensure our API gateway is healthy and performing optimally.</p><h3>The Ultimate Guide to Kong API Gateway (Part 3): Monitoring with Prometheus &amp; Grafana</h3><p>In the final part of our series, we’ll tackle a crucial aspect of running any production system: monitoring. We’ll set up a robust monitoring stack for Kong using two industry-standard open-source tools: Prometheus and Grafana.</p><h3>Why Monitor Your API Gateway?</h3><p>The API gateway is a critical piece of your infrastructure. If it fails or slows down, your entire application can be affected. Effective monitoring helps you:</p><ul><li>Detect Problems Proactively: Identify issues like high error rates or increased latency before they impact users.</li><li>Understand Performance: Analyze API traffic patterns, identify bottlenecks, and make data-driven decisions for scaling.</li><li>Ensure Reliability: Track the health and availability of your gateway and upstream services.</li></ul><h3>The Prometheus &amp; Grafana Stack</h3><ul><li>Prometheus is a time-series database and monitoring system. It works by “scraping” (pulling) metrics from configured endpoints at regular intervals.</li><li>Grafana is a visualization tool that connects to data sources like Prometheus. It allows you to build powerful, interactive dashboards to query and display your metrics.</li></ul><h3>Step 1: Enable the Prometheus Plugin in Kong</h3><p>First, we need to configure Kong to expose its metrics in a format that Prometheus can understand. This is easily done with Kong’s built-in Prometheus plugin.</p><p>Enable it globally so it captures metrics for all traffic passing through Kong:</p><pre>curl -i -X POST http://localhost:8001/plugins \<br>  --data &quot;name=prometheus&quot;</pre><p>By default, the plugin exposes a /metrics endpoint on the Admin API. You can verify this:</p><pre>curl -i http://localhost:8001/metrics</pre><p>You’ll see a long list of metrics like kong_http_status and kong_latency_ms.</p><h3>Step 2: Configure Prometheus to Scrape Kong</h3><p>Next, we need to tell Prometheus where to find these metrics. We’ll add a simple Prometheus configuration and run it via Docker.</p><p>1. Create a Prometheus configuration file:</p><p>Create a file named prometheus.yml:</p><pre>global:<br>  scrape_interval: 15s<br><br>scrape_configs:<br>  - job_name: &#39;kong&#39;<br>    scrape_interval: 5s<br>    static_configs:<br>      - targets: [&#39;host.docker.internal:8001&#39;] # For Docker on Mac/Windows<br>      # For Linux, use: [&#39;&lt;YOUR_MACHINE_IP&gt;:8001&#39;]</pre><p><em>Note: </em><em>host.docker.internal allows the Prometheus container to reach services running on the host machine. If you are on Linux, you may need to use your machine&#39;s actual IP address.</em></p><p>2. Run Prometheus with Docker:</p><p>Now, run the Prometheus container, mounting the configuration file we just created.</p><pre>docker run -d \<br>    --name prometheus \<br>    -p 9090:9090 \<br>    -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \<br>    prom/prometheus</pre><p>You can now access the Prometheus UI at http://localhost:9090. Navigate to the &quot;Status&quot; -&gt; &quot;Targets&quot; page, and you should see your Kong endpoint with a green &quot;UP&quot; state.</p><h3>Step 3: Visualize Metrics with Grafana</h3><p>Finally, let’s visualize the data in Grafana.</p><p>1. Run Grafana with Docker:</p><pre>docker run -d \<br>  --name grafana \<br>  -p 3000:3000 \<br>  grafana/grafana</pre><p>Access the Grafana UI at http://localhost:3000 (default login is admin/admin).</p><p>2. Add Prometheus as a Data Source:</p><ul><li>Log in and go to “Configuration” (cog icon) -&gt; “Data Sources”.</li><li>Click “Add data source” and select “Prometheus”.</li><li>Set the HTTP URL to http://host.docker.internal:9090 (or http://&lt;YOUR_IP&gt;:9090 on Linux).</li><li>Click “Save &amp; Test”. You should see a “Data source is working” message.</li></ul><p>3. Import a Kong Dashboard:<br>Grafana has a vibrant community that shares pre-built dashboards.</p><ul><li>Go to “Dashboards” (four squares icon) -&gt; “Browse”.</li><li>Click “Import”.</li><li>In the “Import via grafana.com” box, enter the ID 7424. This is a popular community dashboard for Kong.</li><li>Select your Prometheus data source and click “Import”.</li></ul><p>You will now have a beautiful dashboard showing key metrics like:</p><ul><li>Requests per Second: The total throughput of your API gateway.</li><li>Latency: The time Kong takes to process requests (p99, p95, p50).</li><li>Status Codes: A breakdown of HTTP status codes (2xx, 4xx, 5xx), which is crucial for spotting errors.</li><li>Bandwidth: The amount of data being sent and received.</li></ul><p>Send some traffic through your test endpoint from Part 1 (curl http://localhost:8000/mock/get) to see the graphs populate in real time!</p><h3>Conclusion of the Series</h3><p>Over these three parts, you have learned how to set up Kong, secure and manage APIs with plugins, and establish a comprehensive monitoring solution. You now have the foundational knowledge to deploy Kong as a robust, scalable, and observable gateway for your microservices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad5183ac53b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to start web development using typescript?]]></title>
            <link>https://medium.com/@sachanyash123/how-to-start-web-development-using-typescript-c1f17008028?source=rss-d422ef620709------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1f17008028</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[expressjs]]></category>
            <dc:creator><![CDATA[Mrigank Sachan]]></dc:creator>
            <pubDate>Fri, 07 Apr 2023 13:34:44 GMT</pubDate>
            <atom:updated>2023-04-07T13:34:44.655Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*esv6JQh-ojJ5SlFF9pAqzw.png" /></figure><h3>What is meant by Web Development?</h3><p>Web development refers to the process of building websites and web applications that can be accessed over the internet. It involves a combination of several programming languages, frameworks, and tools to create dynamic and interactive websites that can handle user inputs, display data, and perform various functions.</p><p>The three main components of web development are:</p><ol><li>Front-end Development: This involves building the user interface (UI) of the website using HTML, CSS, and JavaScript. Front-end developers are responsible for creating a visually appealing and user-friendly interface that can interact with the server-side code.</li><li>Back-end Development: This involves building the server-side logic of the website using programming languages such as PHP, Python, Ruby, or JavaScript. Back-end developers are responsible for handling the data storage, processing user inputs, and communicating with the front-end code.</li><li>Full-stack Development: This involves working on both the front-end and back-end of the website. Full-stack developers are responsible for building the entire website, from the UI to the server-side logic.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*e5HmPVGgeICR-qE8Gks_VA.png" /></figure><p>Web development can also involve using various frameworks and tools to simplify the development process and improve the website’s functionality. Some popular frameworks include React, Angular, Vue.js, and Node.js. These frameworks provide pre-built components, libraries, and tools to help developers build web applications more efficiently.</p><p>In summary, web development is the process of building websites and web applications using a combination of programming languages, frameworks, and tools. It involves creating the user interface, server-side logic, and handling data storage and processing.</p><p>Web development has come a long way since the days of static HTML pages. Today, the web is a dynamic and interactive platform that powers everything from simple blogs to complex applications. If you’re interested in learning how to build web applications, one language that you should consider is TypeScript. TypeScript is a strongly typed superset of JavaScript that offers a number of benefits for web development. In this article, we’ll explore the basics of web development using TypeScript, including some code examples and images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*veOVio78wGlJNdpSRAVfuQ.png" /></figure><h3>Getting Started with TypeScript</h3><p>To get started with TypeScript, you’ll first need to install it on your system. You can do this using the npm package manager, which comes with Node.js. Once you have Node.js installed, you can run the following command to install TypeScript:</p><blockquote>npm install -g typescript</blockquote><p>Or you can visit the below website to install typescript on your compiler:-</p><p><a href="https://www.typescriptlang.org/">JavaScript With Syntax For Types.</a></p><p>Once TypeScript is installed, you can use it to write code that can be compiled into JavaScript. TypeScript provides a number of features that are not available in plain JavaScript, such as static typing, classes, and interfaces.</p><h3>Creating a Basic Web Page with TypeScript</h3><p>Let’s start by creating a simple web page using TypeScript. We’ll begin by creating an HTML file that includes a TypeScript file. Here’s the HTML code:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;title&gt;My TypeScript Web Page&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;h1&gt;Hello, TypeScript!&lt;/h1&gt;<br>    &lt;script src=&quot;app.ts&quot;&gt;&lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>This code creates a basic HTML page with a title and a heading. The script tag at the bottom of the body includes a TypeScript file called app.ts.</p><p>Next, let’s create the TypeScript file itself. Here’s the code:</p><pre>class Greeter {<br>  greeting: string;<br>  constructor(message: string) {<br>    this.greeting = message;<br>  }<br>  greet() {<br>    return &quot;Hello, &quot; + this.greeting;<br>  }<br>}<br><br>let greeter = new Greeter(&quot;TypeScript&quot;);<br>let message = greeter.greet();<br><br>let heading = document.querySelector(&quot;h1&quot;);<br>if (heading) {<br>  heading.textContent = message;<br>}</pre><p>This code defines a class called Greeter that has a greeting property and a greet method. The class takes a string parameter in its constructor, which is used to set the greeting property. The greet method returns a string that includes the greeting property.</p><p>The code also creates an instance of the Greeter class with the greeting &quot;TypeScript&quot;. It then calls the greet method to get a message, and sets the text content of the h1 element to the message using the textContent property.</p><h3>Compiling the TypeScript Code</h3><p>Now that we have our HTML and TypeScript files, we need to compile the TypeScript code into JavaScript. To do this, we’ll use the TypeScript compiler, which we installed earlier.</p><p>Open a command prompt or terminal window and navigate to the directory that contains the app.ts file. Then, run the following command:</p><blockquote>tsc app.ts</blockquote><p>This command will compile the TypeScript code into JavaScript and create a new file called app.js.</p><h3>Running the Web Page</h3><p>Now that we have our HTML and JavaScript files, we can open the HTML file in a web browser to see the results. When we do, we should see the heading “Hello, TypeScript!” displayed on the page.</p><h3>If you want to implement routes using Express :-</h3><p>In this article, we’ll explore how to create a basic web development project using TypeScript and Express. TypeScript is a superset of JavaScript that provides static type checking and other features to make code more maintainable and scalable. Express is a popular web framework for Node.js that provides a range of tools for building web applications. By combining these two technologies, we can create powerful and scalable web applications with ease.</p><h3>Creating a New Project</h3><p>To get started, we’ll need to create a new project directory and initialize it with npm. We can do this using the following commands:</p><pre>mkdir my-project<br>cd my-project<br>npm init -y</pre><p>This will create a new project directory called my-project and initialize it with a package.json file.</p><h3>Installing Dependencies</h3><p>Next, we’ll need to install the dependencies for our project. We’ll need both TypeScript and Express, as well as a few other packages. We can install them using the following command:</p><pre>npm install --save-dev typescript ts-node nodemon @types/express<br>npm install express</pre><p>This will install TypeScript, the TypeScript Node.js runtime (ts-node), the nodemon utility for monitoring file changes, the TypeScript types for Express, and Express itself.</p><h3>Creating a TypeScript Configuration File</h3><p>Before we start writing code, we need to create a TypeScript configuration file called tsconfig.json. This file tells TypeScript how to compile our code. We can create this file with the following command:</p><blockquote>npx tsc — init</blockquote><p>This will create a tsconfig.json file in the project directory. We can leave most of the defaults in place, but we need to change a few settings. In the tsconfig.json file, find the following settings:</p><pre>{<br>  &quot;compilerOptions&quot;: {<br>    /* ... */<br>    &quot;outDir&quot;: &quot;./dist&quot;,<br>    /* ... */<br>  },<br>  /* ... */<br>}</pre><p>Change the outDir setting to &quot;./build&quot;. This will tell TypeScript to output our compiled JavaScript files to a build directory instead of a dist directory.</p><h3>Creating the Express Server</h3><p>With our project set up and our dependencies installed, we can now start writing some code. Let&#39;s create a new file called app.ts in the project directory. This file will contain our Express server code.</p><pre>import express from &#39;express&#39;;<br><br>const app = express();<br><br>app.get(&#39;/&#39;, (req, res) =&gt; {<br>  res.send(&#39;Hello, World!&#39;);<br>});<br><br>app.listen(3000, () =&gt; {<br>  console.log(&#39;Server running on port 3000&#39;);<br>});</pre><p>This code imports the Express module, creates a new instance of the express application, defines a single route that responds with the text &quot;Hello, World!&quot;, and starts the server listening on port 3000.</p><h3>Compiling and Running the Server</h3><p>Now that we have our server code, we need to compile it and start the server. We can do this using the following commands:</p><blockquote>npx tsc</blockquote><blockquote>nodemon build/app.js</blockquote><p>The first command will compile our TypeScript code into JavaScript and output it to the build directory. The second command will start the server using nodemon, which will automatically restart the server whenever we make changes to our code.</p><h3>Testing the Server</h3><p>With our server running, we can test it by visiting http://localhost:3000 in a web browser or using a tool like curl:</p><pre>curl http://localhost:3000</pre><p>This should return the text “Hello, World!”.</p><h3>Conclusion</h3><p>In this article, we’ve explored how to create a basic web development project using TypeScript and also we’ve learned how to implement routes using express and run multiple files at the same time. We learned how to initialize the server on localhost and in the next part i’ll write about more advanced concepts like implementing routes and using typeorm to access the database.</p><p>References:</p><ul><li><a href="https://www.typescriptlang.org/docs/">The starting point for learning TypeScript</a></li><li><a href="https://www.typescriptlang.org/">JavaScript With Syntax For Types.</a></li><li><a href="https://expressjs.com/en/starter/hello-world.html">Express</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1f17008028" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>