███████ ██████ █████ ██████
██ ██ ██ ██ ██ ██
█████ ██ ███████ ██████
██ ██ ██ ██ ██
███████ ██████ ██ ██ ██
super simple email capture service
eCap is a super simple email capture web service. It is designed to validate an email and then simply insert into a postgresql
database.
It's main intention is those looking to capture emails for newsletter subcribers and that are also using some kind of static
site that does not have a backed API.
- Full email validation
- API authentication via
x-api-key
header - Email de-duplication
- Accepts CORS requests (tested under Firefox & Chrome)
Make sure you have sqlx-cli
installed so that you can manually run migrations to make sure that the database schema is in place. Otherwise compilations will fail :|
$ cargo install sqlx-cli
$ sqlx migrate run
$ cargo build
Variable | Description | Example |
---|---|---|
DATABASE_URL | Pg connection string | postgres://dev:pass@localhost/ecap |
API_KEY | API Key for the service | 1f726148-499f-4e5b-b164-1e76ff223af1 |
ECAP_PORT | default is 8080 | 1337 |
$ curl \
-X POST \
-H "Content-Type: application/json" \
-H "X-API-KEY: 63cad126-7373-45dd-a075-8687b148aeeb" \
-d '{"email": "[email protected]"}' \
localhost:8080/submit
Status Code | Body | Description | Example |
---|---|---|---|
200 | string | operation was succcessful | "success" |
400 | string | some validation error message | "email is invalid" |
500 | string | some server side issue | "server error" |
0.1.0-ALPHA
- Fork it (https://github.com/anharhussainmiah/ecap/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- anharmiah Anhar Miah - creator