A webservice to compile and compress various web assets, e.g. LESS, JavaScript, CoffeeScript etc.
Some LESS code in a file.
$ cat style.less
@color-red: red;
@color-green: green;
a {
color: @color-red;
.green {
color: @color-green;
}
}Simply do a POST request with Content-Type: text/less to compile LESS to regular CSS.
$ curl -X POST --data-binary @style.less -H "Content-Type: text/less" http://webassets.herokuapp.com/api/
a {
color: #ff0000;
}
a .green {
color: #008000;
}Want it compressed as well? Add the compress=true query parameter.
$ curl -X POST --data-binary @style.less -H "Content-Type: text/less" http://webassets.herokuapp.com/api/?compress=true
a{color:#ff0000;}a .green{color:#008000;}| Content-type | Header |
|---|---|
| CSS | text/css |
| LESS | text/less |
| Stylus | text/stylus |
| JavaScript | text/javascript |
| CoffeeScript | text/coffeescript |
$ npm install
$ npm test