Giter Site home page Giter Site logo

sba's Introduction

RESTfull Suite Booking API

An example service which provides a RESTfull booking management API for a single suite.

It is written in Javascript for the Node.js runtime, & uses the Express web framework. It uses in memory storage, so don't EVER let it fail!

Start it

The standard way: npm start OR yarn start will bring it up on your machine. If you are already using port 8080, pass it a free port via the SUITE_BOOKING_PORT environment variable like so

The docker-compose way: docker-compose up will bring it up via docker-compose. Standard docker compose commands will then be available docker-compose logs etc...

Run the tests

The tests are run via jest

Current Coverage Report

 PASS  __tests__/booking.test.js
 PASS  __tests__/api.test.js

-------------|---------|----------|---------|---------|-------------------
File         | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------|---------|----------|---------|---------|-------------------
All files    |   86.79 |    84.61 |    92.3 |   86.53 |
 api.js      |   77.77 |       85 |   83.33 |   77.77 | 21-22,38-46
 bookings.js |   96.15 |    83.33 |     100 |      96 | 22
-------------|---------|----------|---------|---------|-------------------

Test Suites: 2 passed, 2 total
Tests:       5 skipped, 11 passed, 16 total
Snapshots:   0 total
Time:        2.013 s

A note to reviewers.

This is not a good example of something I would consider done, and rather reflects more of a re-orientation on implementing a RESTfull API in node.

Cheers, -at :-)

sba's People

Contributors

brevity avatar

Watchers

 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.