Skip to content

gizipp/slim-converter-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruby version html2slim version

GitHub code size in bytes

Slim Converter API

This API powering HTML / ERB to Slim Converter - GIZ Tool.

Usage

Via curl

curl --location --request POST 'https://slim-converter-api.herokuapp.com/convert' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'raw_text=<html>
   <head>
     <title>Enter Your Code Here</title>
   <%= foo = [1,2,3] %>
   <body>
     <%= foo.each do |bar| %>
     <p>Or click Convert to test it out!</p>
   </body>
   </head>
 </html>'

Via Jquery

https://playcode.io/552904

var form = new FormData();
form.append("raw_text", `<html>
   <head>
     <title>Enter Your Code Here</title>
   <%= foo = [1,2,3] %>
   <body>
     <%= foo.each do |bar| %>
     <p>Or click Convert to test it out!</p>
   </body>
   </head>
 </html>`);

var settings = {
  "url": "https://slim-converter-api.herokuapp.com/convert",
  "method": "POST",
  "timeout": 0,
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

API Status

status (24 hours) uptime (past week) uptime (past month) uptime (last hour) response

Feel free to use it, but uptime is not guarantee or deploy this API in Heroku.

Deploy