Git Product home page Git Product logo

mypostman's Introduction

myPostman

Just a super-simple HTML + JS app for calling an API asynchronously and displaying the results.
(almost*) No frameworks / libraries used; just plain ol' JS.

*Uses Prism for syntax highlighting, just so it's prettier.

Usage

You can set up a pre-existing server with the required API (/spaces?format={format}) to serve the public directory, and browse to 'index.html'.

Alternatively, you can use the provided simple express server using node main.js from the server directory.
*note that you need express installed for that (npm install express).

What's nice about this?

  1. Clear separation of concerns makes the code more maintainable and testable (see below on how to extend for testing).
    The largest module is the controller, which coordinates the UI with the backend;
    It's separated from any business logic or data manipulation, so those can be changed or replaced without changing code relating to the UI (for example- it's easy to change the data retrieval method, or the supported formats, without changes to the controller itself).
  2. Internationalization is easy using translation modules.
  3. Tiny- the whole thing is 15KB non-minified.

What can be improved?

  1. Display the full info about the response:
    The dataService module can be extended to return more info about the response (i.e headers).
    It's then very easy to display it with Prism, using language-http.
  2. Unit tests:
    It's fairly easy to write a test page that'd test the functionality of the mainController module;
    Simply create an HTML file with the required elements (textbox, button, dropdown), and the dependencies can be easily mocked.
  3. Cross-browser minor issues
    So obviously this works great with FF and Chrome, but IE is a different story, as usual.
    The app is fully functional on IE10 and 9, however, for IE9 on a very small screen, the UI looks significantly less attractive (since IE9 doesn't implement flex).
    Had I had more time, and IE9 was a critical issue, I would've tried some workarounds (for example- http://stackoverflow.com/a/28709421)

mypostman's People

Contributors

sjhonny-e avatar

Watchers

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