Giter Site home page Giter Site logo

paint's Introduction

ARCHIVED: At this time, Ambassify is not maintaining this code anymore.

You can still use it if you like.

Paint

SASS building microservice.

Deploy

Usage

Check the app.json file for any environment variables you might need to add or want to replace. Settings ENVIRONMENT to [value] will cause the app to try and load the .env/[value] file into your environment. This is an easy way to add variables, but don't use this for confidential information.

npm install
npm start

API

/

Display information about the Paint service.

/paint

Compile SASS into CSS.

Parameters:

  • src: The source SASS to compile. Either plain SASS, a link to an SASS file or a link to a (optionally gzipped) tarball containing SASS files. In case of an archive, there needs to be a style.scss file in the root. Optionally, you can include an options.json file in the archive that sets the options as explained below for the opt parameter.

  • var: Array of SASS variables to use during compilation. E.g. ?var[primary]=green will result in $primary: green;

  • uvar: Link to a JSON file that contains SASS variables to use during compilation. Example JSON below.

{
    "primary": "green",
    "secondary": "#F00"
}

will result in:

$primary: green;
$secondary: #F00;
  • opt: Array of options for the service to use. Currently, none are supported. In the future it might look like this: ?opt[autoprefixer][browsers]=last%202%20versions&opt[scss][style]=nested to enable the autoprefixer plugin and configure it to support the latest 2 browser versions as well as configure the nested output format for your CSS result.

Development

See usage but replace npm start with npm run dev to run a watch task and reload the server every time you make changes to the code. Some environment variables may not be provided by default for security reasons, ask one of the developers for help if you need these.

Contribute

We really appreciate any contribution you would like to make, so don't hesitate to report issues or submit pull requests.

License

This project is released under a MIT license.

About us

If you would like to know more about us, be sure to have a look at our website, or our Twitter accounts Ambassify, Sitebase, JorgenEvens

paint's People

Contributors

gertsallaerts avatar gertt avatar jorgenevens avatar sitebase avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pretty civitium

paint's Issues

API response is empty sometimes

When requesting config, the response is logged as empty sometimes. See if we can add some logging to find out if something goes wrong on our end or the api itself

Caching

Ideas for caching

  • Cloudfront
  • HTTP caching (with ETag, If-Modified, ...)
  • Save downloaded resources locally and don't request them again if present
  • Save result sass locally and return if URL hasn't changed

How do we enable pre-fixing?

I see the opt param isn't enabled yet so we can enable pre-fixing, is there a way to manually enable in our own build?

Access Control

Limit who can use the service. Traditional approaches like API keys or authentication are not desirable since your styling needs to be publicly available to users.

Ideas:

  • Limit allowed sources

PostCSS

Unity uses PostCSS with autoprefixer plugin to make nice cross browser CSS.

Threading

Investigate if it would be beneficial to use concurrent node processes

Health check

I've updated the pingdom health check that it use the Heroku URL instead of the cached CloudFront URL.
I've also added an assert that will make sure body{ is present in the returned response.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.