Categorygithub.com/diegovictor/named-api
modulepackage
0.0.0-20241118123149-8c96c9bb5443
Repository: https://github.com/diegovictor/named-api.git
Documentation: pkg.go.dev

# README

[API] Named

GitHub Workflow Status (branch) GitHub go.mod Go version coverage MIT License PRs Welcome
Run in Insomnia}

Responsible for provide data to the web front-end. Generates names based on preseted datasets (list of example names), but you can upload a custom dataset (it must have at least 23 names). Was utilized the Markov Chain algorithm to generate the names, a custom script was created based on this article: Generating Startup names with Markov Chains.

Live Demo: https://named-api.onrender.com/

Table of Contents

Requirements

Usage

To start up the app run:

$ go run .

Or:

go run main.go

Or even:

$ ./scripts/run.sh

Routes

routeHTTP Methodparamsdescription
/datasetsGET-Retrieve available datasets.
/namesGETdataset query parameter.Generate names for the dataset provided.
/feedbacksPOSTBody with an array of feedbacks with name and value.Save good feedbacks
/uploadPOSTBody with dataset form data (See insomnia file for good example).Create a custom dataset.

Requests

  • POST /feedbacks

Request body:

[
  {
    "name": "Jordan",
    "value": 1
  }
]
  • POST /upload

Request body:

"file"=<file>

Running the tests

To run the projects' tests the app:

$ ./scripts/test.sh

Or:

$ go test ./tests/... -cover -coverpkg=./controllers,./helpers -coverprofile=coverage-report.out

Coverage report

You can see the coverage report on root folder coverage-report.out. They are automatically created after the tests run (with you used the command above).

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author