Coder Social home page Coder Social logo

himanshuraj98 / express-intersections-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3.77 MB

Line Intersection API - The Line Intersection API is used to find intersecting lines with a given linestring. It accepts a linestring in GeoJSON format and checks for intersections with a set of randomly spread lines.

Home Page: https://express-intersections-api-production.up.railway.app/

License: MIT License

TypeScript 100.00%
typescript express-server api bcrypt body-parser jsonwebtoken morgan nodemon turf-js

express-intersections-api's Introduction

Express Server README

Himanshu Raj

Project Assignment For MAPUP.AI

This is the README file for an Express server application. The server is built using Node.js and utilizes the Express framework to handle HTTP requests. It includes various middleware, routes, and custom contexts.

Table of Contents

Deployed Server Link :

Dependencies

The following dependencies are used in this project:

  • Express: Fast, unopinionated web framework for Node.js
  • body-parser: Node.js body parsing middleware
  • dotenv: Loads environment variables from a .env file
  • morgan: HTTP request logger middleware
  • jsonwebtoken: JSON Web Token implementation for token verification

Make sure to install these dependencies before running the server.

Getting Started

  1. Clone the repository to your local machine.
  2. Put Secrect Key In .env file In JWT_SECRET Variable.
  3. Install the required dependencies using a package manager like npm or yarn.
  4. Use command (npm install -dev)
  5. Set up the environment variables by creating a .env file and providing the necessary values.
  6. Run the server using the appropriate command (npx ts-node dist/index.js).

Middleware

The server uses the following middleware:

  • body-parser: Parses JSON and URL-encoded request bodies with a payload size limit of 50mb.
  • morgan: Logs HTTP requests in the "combined" format.

Routes

The server defines the following routes:

  • /: Returns a "Server is Up!" response for the root URL.
  • /api/v1: Mounts the GeoJSONRouter middleware, which handles specific routes related to GeoJSON data.
  • /auth: Mounts the UserRouter middleware, which handles user authentication routes.

Starting the Server

To start the server, run the appropriate command (e.g., npx ts-node dist/index.js) in the project's root directory. The server will listen on the port specified in the environment variables.

express-intersections-api's People

Contributors

himanshuraj98 avatar

Stargazers

 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.