Categorygithub.com/maxpang93/credit-card-number-validator
modulepackage
0.0.0-20240412150912-139e17b2c5e3
Repository: https://github.com/maxpang93/credit-card-number-validator.git
Documentation: pkg.go.dev

# README

credit-card-number-validator

Just a simple Golang project to gain proficiency.

The web server only has two endpoints:

  1. /ping to check if the server is working.
  2. /validate to validate a credit card number using Luhn Algorithm

To start up the web server, either

  • At root, run:
     go run main.go
    
  • Or use Docker:
    • Build image:
    docker build -t credit_card_number_validator .
    
    • Run container:
    docker run -p 8081:8080 credit_card_number_validator
    

Example:

  1. /ping
    curl -X GET "localhost:8081/ping"
    
  2. /validate
     curl -X POST "localhost:8081/validate" -H "Content-Type: application/json" -d '{"creditCardNumber": "17893729974"}'
    

# Packages

No description provided by the author