# Getting Started
This repository provides a simple API with Swagger documentation generated using swaggo. In this guide, you will learn how to modify swag godoc, format and generate spec docs, and run the Swagger server to review the API documentation.

## Prerequisites
* Install Go (version 1.17 or higher)

## Modifying Swag Godoc
To modify the swag godoc, you need to edit the documentation comments in the relevant Go files. In the given example, the `serverless/serverless.go` file contains the `ListServerlessCloudProviders` function with its swag godoc comments.

To write the swaggo comments, you can follow the declarative comments format as specified in the [Swag documentation](https://github.com/swaggo/swag#declarative-comments-format).

To edit the swag godoc comments, simply update the lines starting with `// @` above the function or type definitions.

## Formatting Swag Godoc
To format your swag godoc comments, use the `fmt` command in the `Makefile`:

```bash
make fmt
```

This command will format both your Go code and swag godoc comments to keep them consistent and readable.

## Generating Spec Docs
To generate the Swagger spec docs, use the `swag` command in the `Makefile`:

```bash
make swag
```

This command will generate the Swagger documentation in the `./docs` folder.

## Running Swagger Server
To run the Swagger server and review the API documentation, use the `run` command in the `Makefile`:

```bash
make run
```

This command will start the API server. Once it's running, you can view the Swagger documentation by navigating to http://localhost:8080/swagger/index.html in your browser.
