Coder Social home page Coder Social logo

micro-frontend's Introduction

Exercise 1

We currently have a monolithic application called main-application it is using angular routing to load in a checkout page. We want to make a new checkout service which has a different view and different logic. It should be possible to deploy the services separate from each other. In this exercise we are going to integrate the new service using angular templates which are ajax'ed by angular by default.

A load balancer/reverse proxy has to be configured to ensure both service run on the same port. Load balancers can do url rewriting as well.

  1. Run npm install in main-application/ and proxy/
  2. Run npm start in main-application
  3. Browse to the clientside checkout tab on localhost:3000
  4. Create a server serving an angular controller and a template (tip: look at the default placeholder, use nws to make a simple web server: npm install -g nws)
  5. Edit proxy/index.js to ensure both application are running on the same port. It might be needed to do url rewriting.
  6. Run the proxy with npm start in proxy/ NOTE that the server will reload automatically when index.js is changed.
  7. See the results on localhost:5000
  8. (optional) update the load balancer to load in a service from a different participant.

Exercise 3

We realised that we need to integrate the checkout page using server side integration. We are going to use compoxure to do this.

  1. Add a compoxure include statement on the serverside checkout page at './main-application/app/checkout-server/checkout.html'
  2. Configure compoxure in compoxure-server/config.json
  3. Make sure redis is running
  4. Start compoxure by running npm start in compoxure-server/.
  5. See the results on localhost:5000
  6. (optional) update the include tag to load in a service from a different participant.

micro-frontend's People

Contributors

0xr avatar jschulenklopper avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.