Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chronotruck/mjml2html
Expose a simple API to convert MJML to HTML on the fly.
https://github.com/chronotruck/mjml2html
api docker email express mjml nodejs
Last synced: 2 days ago
JSON representation
Expose a simple API to convert MJML to HTML on the fly.
- Host: GitHub
- URL: https://github.com/chronotruck/mjml2html
- Owner: chronotruck
- License: mit
- Created: 2018-08-06T13:09:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:34:56.000Z (almost 2 years ago)
- Last Synced: 2023-02-26T10:08:31.023Z (over 1 year ago)
- Topics: api, docker, email, express, mjml, nodejs
- Language: JavaScript
- Homepage: https://github.com/orgs/chronotruck/packages/container/package/mjml2html
- Size: 1.55 MB
- Stars: 13
- Watchers: 3
- Forks: 2
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# MJML2HTML
![CircleCI](https://img.shields.io/circleci/project/github/chronotruck/mjml2html/master.svg)
![Dependencies](https://img.shields.io/david/chronotruck/mjml2html.svg)
![Dev Dependencies](https://img.shields.io/david/dev/chronotruck/mjml2html.svg)
![Docker Pulls](https://img.shields.io/docker/pulls/chronotruck/mjml2html.svg)
[![License](https://img.shields.io/github/license/chronotruck/mjml2html.svg)](https://github.com/chronotruck/mjml2html/blob/master/LICENSE)> Simple API to convert MJML content to HTML on the fly.
## Requirements
- Git
- Docker
- Docker-compose## Getting started
To set-up the project, run the following command:
```bash
docker-compose up
```Once the Docker is running, you can use your API endpoint under `localhost:3001`.
## Usage
This project exposes a `POST` endpoint under `/`. To make it work, you must send a `text/plain` body with your MJML content.
When received, the server converts your MJML into an HTML string and returns the content as `text/html`.## Example
```bash
curl --header "Content-Type: text/plain" \
--request POST \
--data 'Hello!' \
http://localhost:3001/
```May return:
```html
Hello!
```## API
To use the API params, you can pass them as query parameters
`localhost:3001/?comments=false&minfiy=true`.| Param | Type | Default | Possible values |
|------------|------------|------------|------------
| comments | Boolean | false |
| minify | Boolean | false |
| beautify | Boolean | false |
| validation | String | strict | skip, soft, strict## License
This project is licensed under [MIT License](http://en.wikipedia.org/wiki/MIT_License)