GithubHelp home page GithubHelp logo

go-search's Introduction

Go-search

Leo Annette - 6th August 2023

This is a simple REST API service that provides a search functionality for the github project

GitHub Project Search API in Go

Introduction

This project is a simple REST API service built in Go that provides search functionality for the GitHub project Awesome Go. The API service allows users to search for GitHub projects from the Readme file of the "awesome-go" repository. It has two endpoints, as described below:

  1. /projects: This endpoint produces a list of all GitHub projects extracted from the Readme file of the "awesome-go" project. The response payload is in JSON format and returns a list of project URLs.

  2. /projects?name={project_name}: This endpoint takes a query parameter "project_name" as input, which can be any string (e.g., "json" or "audio" or any other term). The response will be a list of projects in JSON format where the GitHub project name contains the specified "project_name" value.

How to Run

To run the API service locally, follow these steps:

  1. Make sure you have Go installed on your machine.

  2. Clone this repository to your local machine.

  3. Open a terminal or command prompt and navigate to the root directory of the cloned repository.

  4. Run the following command to start the API service:

go run main.go

  1. Once the service is running, open your web browser and go to the following URL to search for projects containing a specific name (e.g., "json"):

http://localhost:8000/projects?name=json

  1. The API will return a JSON response containing a list of projects whose names match the search query.

  2. To see a list of all projects from the "awesome-go" Readme file, you can visit the following URL:

http://localhost:8000/projects

Example Response

If you search for projects with the name "json," the API will return a response similar to the following:

{
"projects": [
 { "url": "https://github.com/spyzhov/ajson" },
 { "url": "https://github.com/cocoonspace/dynjson" },
 { ... }
]
}

Note

This API service is built as a home assignment, and it solely serves as an example of creating a basic REST API in Go for searching GitHub projects. It is not intended for production use and might not include advanced error handling or other production-grade features.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.