Monday, 27 January 2020

Minimal Yet Advanced Code Base for Webapps, Websites

Front-end:
  • Use jQuery
  • Use $.load and $.getScript to load static files
    $("#Some-Id").load("/static/file.html",()=>{
      //Load JS here to have HTML already ready
      $.getScript("/static/file.js");
    });
  • Load screen static files based on the URL in address bar
  • Load component static files in screen .js file
Back-end:
  • Use Express.js to serve static files only, no other URL handling.
  • Use Socket.io to serve JSON data in the  webapp style.
  • APIs  run through Socket.io, not HTTP/s protocol.

No comments:

Post a Comment