Contributing
Setup
pipenv install -d
pipenv run pre-commit install --config .pre-commit-config.yml
pipenv run inv qa
Running locally
-
Set and load environment variables:
cp .example.env .env edit .env pipenv shell
-
Run dev server:
or if using VSCode, use the following configuration inuvicorn mailer.app:app --host 0.0.0.0 --port 8000
.vscode/launch.json
:{ "version": "0.2.0", "configurations": [ { "name": "mailer:app", "type": "python", "request": "launch", "module": "uvicorn", "args": ["--host=0.0.0.0", "--port=8000", "mailer:app"], "envFile": "", "justMyCode": false }, { "name": "mailer:tests", "type": "python", "request": "test", "justMyCode": false } ] }
-
Try it:
http GET http://localhost:8000/ http POST http://localhost:8000/api/mail \ Origin:http://localhost:8000 \ email="john@doe.com" \ name="John Doe" \ subject="Test 💫" \ message="Hello 👋" \ honeypot=""
-
Open the Swagger OpenAPI documentation at http://localhost:8000/docs
Examples
Run the examples:
cd examples
pipenv run python -m http.server 5000