Giter Club home page Giter Club logo

netlify-serverless's Introduction

NETLIFY SERVERLESS

A serverless Backend application developed with Express.js and deployed ๐Ÿš€ in Netlify functions.

Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors License Badge

Interested in the project? Please visit my website


It is a good software engineering practice to separate portions of your code function to work independently of other parts. Since your codes are made up of functions basically, serverless functions allow you to deploy those functions without the complexity of managing a server to run them (Olutunmbi Banto, 2020). This repository was created as part of a Big Data project in which services must be consumed from a database made in MondoDB with the historical information of the flights of US airlines. The APIs will be consumed by a SimpleMongoCRUD Frontend developed in Angular.

Logo


If you like this Repo, Please click the โญ

Contents

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps. Also, you can check this tutorial.

Prerequisites

List of things you need to use this project and how to install them.

  • netlify CLI
    npm install -g netlify-cli

Installation

  1. Clone the repo
    git clone https://github.com/TheWorstOne/netlify-serverless.git
  2. Install NPM packages
    npm install
  3. Enter your MONGO URI in .env in the root directory for local deployment
    MONGO_DB_CONNECTION="mongodb+srv://<username>:<password>@<database>.n5qog.mongodb.net/<collection>?retryWrites=true&w=majority"

Usage

To use this project in your local environment, follow the steps below.

For a more detailed explanation you can check this guide

  1. To initialize the root folder with netlify
    netlify init
  2. For local deployment you can use both commands
    npm start
    netlify dev
  3. To access serverless functions in the browser, use the URL
    http:localhost:PORT/.netlify/functions/app/
  4. You can check all the functions in the src/routes/flights.js
     router.post("/new", FlightController.createFlight);
     router.get("/number/:FlightNum", FlightController.getFlightByNumber);
     router.get("/search/:flightId", FlightController.getFlightById);
     router.get("/numbers", FlightController.getFlightNumbers);
     router.put("/update/:_id", FlightController.updateFlight);
     router.delete("/delete/:flightId", FlightController.deleteFlight);
    To access these services you must use the following URI http:localhost:PORT/.netlify/functions/app/flights/<serverless function>

Deployment

If you want to deploy your own serverless on netlify, follow the next steps. Make sure your github repository is linked to your project on the netlify website

  1. Deploy to production
    netlify deploy --prod
  2. If you have problems with environment variables at deployment time, you can use the interface provided by the netlify website. In your site overview go to Site settings > Build & deploy > Environment > Edit variables

Logo

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Miguel รngel Macรญas - ๐Ÿ‘จโ€๐Ÿ’ปLinkedin

My Personal Website: โœจmangelladev.com

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.