https://github.com/danihodovic/mjml-server
MJML wrapped in Express for use over HTTP
https://github.com/danihodovic/mjml-server
email email-marketing email-template emails expressjs mjml nodejs responsive-email
Last synced: 3 months ago
JSON representation
MJML wrapped in Express for use over HTTP
- Host: GitHub
- URL: https://github.com/danihodovic/mjml-server
- Owner: danihodovic
- License: mit
- Created: 2019-07-15T06:42:41.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-23T22:13:02.000Z (over 1 year ago)
- Last Synced: 2025-03-25T22:36:32.610Z (7 months ago)
- Topics: email, email-marketing, email-template, emails, expressjs, mjml, nodejs, responsive-email
- Language: JavaScript
- Homepage:
- Size: 458 KB
- Stars: 44
- Watchers: 2
- Forks: 19
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mjml-http-server
A self-hosted alternative to the mjml API. Built with express.
The API is compatible with https://mjml.io/api in that it only exposes one
endpoint - `/v1/render`, but doesn't require authentication. You should probably
run this within your own private network.#### Why?
You're writing an app in another language than Javascript and need to interop
with MJML. Instead of embedding NodeJS in your Python image you can call MJML
compilation over HTTP.You can alternatively use the [MJML API](https://mjml.io/api), but it's
currently invite only and has privacy implications (do you want your emails to
be sent to yet another third party?).For an elaborate discussion see: https://github.com/mjmlio/mjml/issues/340
#### Usage
```
docker run -p 15500:15500 danihodovic/mjml-server
``````
$ http POST localhost:15500/v1/render
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 2141
Content-Type: application/json; charset=utf-8
Date: Mon, 15 Jul 2019 12:26:48 GMT
ETag: W/"85d-hn49R397DBvYcOi5/4cb+gcoi/I"
X-Powered-By: Express{
"html": "\n \n ..."
}
```#### Configuration
A list of available configuration options can be found in
[./lib/parse_args.js](./lib/parse_args.js).