GithubHelp home page GithubHelp logo

murasutv / instant-articles-builder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebookarchive/instant-articles-builder

0.0 0.0 0.0 4.64 MB

Instant Articles Rules Editor

Home Page: https://facebook.github.io/instant-articles-builder

License: Other

Shell 0.53% JavaScript 89.97% PHP 2.93% CSS 5.65% HTML 0.63% Dockerfile 0.29%

instant-articles-builder's Introduction

Facebook Instant Articles Builder

CircleCI

Instant Articles Builder helps you to create a template to build Facebook Instant Articles from articles on your website.

Try it out (Windows/Mac): https://facebook.github.io/instant-articles-builder/

Building from source

Run (on the root of the project):

npm install

Launching the App

Just run (on the root of the project):

npm start

Testing

Run the following command (on the root of the project):

npm test

Preview config

To enable the experimental preview of the Instant Article, you can run the webserver locally or point to a remote one.

There are three environment variables that are used to configure the webserver:

  • IA_BUILDER_START_LOCAL_PREVIEW_WEBSERVER (true|false). Optional.
    • When true, when launching the Builder it will start the local webserver (requires php to be installed locally)
    • Default value: true
  • IA_BUILDER_PREVIEW_WEBSERVER_HOST ({protocol}:{hostname}). Optional.
  • IA_BUILDER_PREVIEW_WEBSERVER_PORT ({port number}). Optional.
    • When present overrides the port of the webserver
    • Default value: 8105

Local webserver

To enable the preview using a local webserver (which requires PHP to be installed in your local environment) navigate to the webserver directory:

cd webserver

And install the composer dependencies:

composer install

Remote webserver

You may also point to a remote webserver for the preview. To configure the remote webserver you can use the mentioned environment variables, or if you are building from source you can create a file called .env in the root of the repo with content similar to:

IA_BUILDER_START_LOCAL_PREVIEW_WEBSERVER=false
IA_BUILDER_PREVIEW_WEBSERVER_HOST=http://localhost
IA_BUILDER_PREVIEW_WEBSERVER_PORT=8105

You can use the Docker image included in this repo under docker/webserver to get a webserver instance running locally in Docker.

Single container (no cache)

You can get a single container with the webserver without cache by running the following command to build the image:

docker build ./docker/webserver -t ia-webserver

and then the following command to run your container and make it accessible through the 8105 port (which is also configurable):

docker run -it --rm -p 8105:8000 --name ia-webserver ia-webserver:latest

Docker-compose (with cache)

Update .env with the port according with docker-compose file. As default, memcache it is configured: "8107:8000".

You can get a webserver with cache (using memcached) by running the following command from the `Docker/webserver/ folder:

docker-compose up

You can take a look at the cache stats by going to http://localhost:11212.

once you are done you can stop both containers with the following command:

docker-compose down

License

Please read the LICENSE file for more information.

instant-articles-builder's People

Contributors

pestevez avatar diegoquinteiro avatar nataliemt avatar eduardocesb avatar timjacobi avatar mburak avatar dependabot[bot] avatar dperezmiami avatar everton-rosario avatar facebook-github-bot avatar gisedaye avatar dlackty avatar

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.