prestonzen/mailcheck-backend

By prestonzen

Updated over 1 year ago

Lightweight rack-based API for email validation using Truemail, with CORS support for frontend apps.

Image
Message queues
API management
0

251

prestonzen/mailcheck-backend repository overview

📧 Mail Check Backend — Truemail Rack API

Mail Check Backend is a lightweight, rack-based web API for email validation using the Truemail API. Built for simplicity and efficiency, it integrates seamlessly with frontend applications, providing fast and accurate email validation services.


🛠️ Key Features

  • 🚀 Efficient Email Validation: Validates emails with the Truemail API, supporting batch processing for high performance.
  • 🔧 Customizable: Easily configure verification settings, access tokens, and more.
  • 🌍 CORS Support: Fully compatible with modern web frontends by enabling Cross-Origin Resource Sharing (CORS).

⚙️ Important Note: CORS Fix

To allow frontend applications to connect to the backend, CORS must be enabled. Below is the complete config.ru file with the necessary CORS settings:

# frozen_string_literal: true

require_relative 'config/loader'
require 'rack'
require 'rack/cors'

use Rack::Cors do
  allow do
    origins '*' # Replace '*' with specific domains if needed
    resource '*',
             headers: :any,
             methods: [:get, :post, :options, :put, :delete],
             expose: ['Authorization']
  end
end

run TruemailServer::RackCascade

This configuration ensures secure communication between the backend and frontend, especially when hosted on different domains.


🚀 Getting Started

  1. Pull the pre-built Docker image from Docker Hub:

    docker pull prestonzen/mailcheck-backend
    
  2. Run the container:

    docker run -p 8080:8080 prestonzen/mailcheck-backend
    
  3. Test the healthcheck:

    curl http://localhost:8080/healthcheck
    
  4. (Optional) If building locally, use the provided Dockerfile:

    docker build -t mailcheck-backend:1.0 .
    docker run -p 8080:8080 mailcheck-backend:1.0
    

Tag summary

Content type

Image

Digest

sha256:72f3715d7

Size

49.4 MB

Last updated

over 1 year ago

docker pull prestonzen/mailcheck-backend