GithubHelp home page GithubHelp logo

rectangles-demo's Introduction

Analyzing Rectangles

Express + Swagger + tsoa

This backend application consist of a REST API which exposes the ๐Ÿ‘‰ endpoints documented by Swagger at APP_HOST:APP_PORT/docs path. See the Swagger section for more details.

Environment

This aplication is created using Node.js v20. It is recommended using nvm (Node Version Manager) to manage Node.js versions. Go to github.com/creationix/nvm and check the installation process for your OS.

Make sure to set the env variables. For local environment you can create a .env file with the following environment variables:

APP_HOST=localhost
APP_PORT=3004

After cloning the repository rectangles-demo you must install the dependencies by running in the terminal:

npm install

VS Code Extensions

It is recommended to install de suggested VS Code extensions suggested in the file .vscode/extensions.json.

To test the API, you can use the REST Client extension, which allows you to send HTTP request and view the response in VS Code.

Files with the extension ".http" are recognized by REST Client. In roder to send a HTTP request, just select the query, then press F1, and select:

  • Rest Client: Send Request

Running the server

After all dependencies are installed, just run the command:

npm run swagger # to generate server routes
npm run dev:server

Swagger

This projects uses tsoa along with swagger-ui-express to generate the documentation. The folder src/swagger contains files autogenerated by tsoa, that includes routes and swagger spec files specified in tsoa.json. The server uses ['/docs', '/openapi', '/swagger'] routes to deliver static content with the API documentation generated by tsoa.

Testing

To run all unit tests, just run the following command:

npm run test

Build

To build in production mode, just run the following command:

npm run build-all

Endpoints

The following endpoints are exposed by Express:

  • /adjacency
  • /containment
  • /intersection

These are some base cases to analyze rectangles:

Rectangles base cases

And these are some test cases for adjacency, containment, and intersection.

Rectangles test cases


husky

Edit package.json > prepare script and run it once:

npm run prepare

See: conventional-changelog/commitlint.

standard-version

standard-version needs to have a starting point to append the CHANGELOG and other versions to. Simply run:

npm run release -- --first-release

Usage

For a new release, just run

npm run release

For more details, please visit the Github site standard-version

rectangles-demo's People

Contributors

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