Hello World API

Get started with building your first API

1 hour
easy
3 submissions

Project Overview

Get started with building your first API

Create a simple API with a single GET endpoint, /hello, that responds with "Hello world" and a 200 OK status. This project is an introduction to setting up a basic server, handling requests, and sending responses. Use any technology stack you prefer!

Your submissions

No submissions yet, start by making your first submission

Detailed Project Description

Welcome to the Hello World API project! This is a simple yet foundational project to help you understand how to set up and deploy a basic server application that responds to client requests.

🌐 Project Overview

The goal of this project is to create a basic API endpoint that returns a "Hello world" message. You’ll set up a single route that responds to a GET request with a 200 OK status and the text "Hello world". This project is a great way to practice setting up servers, routing, and API basics.

Requirements:

  • Endpoint: Your API should have a GET /hello route.
  • Response: The response should include:
    • Status Code: 200 OK
    • Message: "Hello world"

🛠 Learning Objectives

By working on this project, you’ll:

  • Set up a basic server with any backend framework or language of your choice.
  • Define a route to handle GET requests.
  • Understand how to respond with status codes and messages.

💻 Choose Your Technology

You’re free to use any technology stack you prefer! Here are a few options to consider:

  • Node.js: Use frameworks like Express or NestJS.
  • Python: Try using Flask or Django.
  • Java: Set up a server with Spring Boot.
  • Ruby: Use Sinatra or Rails to create the endpoint.
  • PHP: Try Laravel or a simple PHP script.

This flexibility allows you to practice with a technology you’re comfortable with or to try something new!

🚀 Project Steps

  1. Set Up the Project: Initialize your project and install any necessary dependencies.
  2. Define the Route: Set up a /hello route that handles GET requests and returns the "Hello world" message.
  3. Listen on port 3033: Your project should be made to listen on port 3033.
  4. Run and Test the Server: Start your server and test the endpoint by visiting /hello in a browser or a tool like Postman.

🔍 Testing Your Endpoint

After setting up your server, test it by navigating to http://localhost:3033/hello in a browser or sending a request from Postman to confirm that it returns "Hello world" with a 200 OK status.

📚 Additional Resources

This Hello World project is a great opportunity to explore different technologies and understand the fundamentals of setting up and testing an API endpoint. Enjoy coding!

Project Completion Criteria

  • You should have an api route "/hello" that returns the text "Hello world"