GithubHelp home page GithubHelp logo

corporate-org / quote-fe Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 24.0 1 KB

This frontend can be used as a widget in an <iframe> to show a quote along with the name of a sponsor.

Dockerfile 17.19% JavaScript 82.81%

quote-fe's Introduction

Sponsored Quote Frontend

This frontend can be used as a widget in an <iframe> to show a quote along with the name of a sponsor.

The sponsor name is defined by the environment variable: QUOTE_SPONSORED_BY. The quotes are provided via a /quotes endpoint which is expected to serve a random quote in the following format:

{
  text: "QUOTE TEXT",
  author: "QUOTE AUTHOR"
}

The quotes webservice can be configured via the QUOTE_SERVER_NAME environmental variable.

By default, this container serves on port 8080. However, this can be configured via the PORT environmental variable.

Running Locally

Assuming the quotes server is running on localhost on port 3001, and the sponsor name is "Sponsor", the frontend can be run locally with the following command in the root of the repository.

QUOTE_SERVER_NAME="localhost:3001" QUOTE_SPONSORED_BY="Sponsor" node index.js

The frontend can be accessed in a browser with the following URL:

http://localhost:8080/

Building & Running the Docker Image

To build the docker image, use the following command in the root of the repository:

docker build .

Assuming the webservice providing quotes is running on port 3001, the docker image can be run with the following command:

docker run \
	-p8080:8080 \
	-e QUOTE_SERVER_NAME="localhost:3001" \
	-e QUOTE_SPONSORED_BY="Sponsor" \
	--name quote-fe \
	quote-fe

The container can be stopped with the following command:

docker stop quote-fe

quote-fe's People

Contributors

chrishumanitec avatar

Watchers

James Cloos 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.