Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rix1/refactor api #13

Merged
merged 6 commits into from
Oct 10, 2019
Merged

Rix1/refactor api #13

merged 6 commits into from
Oct 10, 2019

Conversation

rix1
Copy link
Owner

@rix1 rix1 commented Oct 1, 2019

This PR removes a couple of endpoints (hello and sendgrid) and refactors the API to make it more ergonomic:

Old 🧟‍♂️

  • /api/email/mailgun/send/test@domain.com
  • /api/email/sendgrid/send/test@domain.com
  • /api/auth/verify/<some-token>
  • /api/data/<some-id>
  • /api/hello

New 💅

  • /api/email/test@domain.com
  • /api/verify/<some-token>
  • /api/data/<some-id>

I also reorganised the /src/email files according to content type of the email. The motivation for this was to prepare for better HTML support as mentioned in #5.

Old 🧟‍♀️

src/
├── email
│   ├── base-template.html
│   ├── email.js
│   ├── email.test.js
│   └── index.js

New 🤸‍♀️

src/
├── email
│   ├── html
│   │   ├── base-template.html
│   │   ├── index.js
│   │   └── inlineStyles.js
│   └── plaintext
│       ├── generateVerifyEmail.js
│       └── generateVerifyEmail.test.js

I organized the files according to message content type
e.g. plaintext and html
Because of SendGrid's old Node version requirement we want to continue with
mailgun and deprecate the SendGrid endpoint
Given a domain name like auth-now.sh this will give us the following API
url: `auth-now.sh/api/email/test@domain.com`
To better support future logging to external services
@rix1 rix1 self-assigned this Oct 1, 2019
@rix1 rix1 requested review from tomfa and andrroy October 1, 2019 20:25
@rix1 rix1 changed the base branch from master to rix1/add-tests October 1, 2019 23:02
@rix1 rix1 merged commit 7da0231 into rix1/add-tests Oct 10, 2019
@rix1
Copy link
Owner Author

rix1 commented Oct 10, 2019

Growing impatient so I'm merging this NOW 😅

impatient

@rix1 rix1 deleted the rix1/refactor-api branch October 10, 2019 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant