Giter VIP home page Giter VIP logo

serverless-firestore-crud-api's Introduction

CRUD API using Serverless (Google Cloud Functions and Firestore)

This is a basic demonstration for how to do CRUD tasks (Create, Read, Update, Delete) in an API-like way on a Firestore database.

What's so sweet is that you don't need to set up any kind of server or other typical backend stuff – just write your code! Serverless for the win :)

Get started

  1. Make sure your credentials are in order (read more at Serverless)
  2. Create a keyfile.json in the root of the project (read more at Google)
  3. Update projectId in the instance called firestore
  4. Run serverless deploy

CLI Commands

The command serverless can also be used in its shorthand form sls.

  • serverless invoke -f create -d '{ "title": "Some title", "text": "Content goes here" }: Create new document in the posts collection
  • serverless invoke -f read: Read all posts documents (outputs to console)
  • serverless invoke -f update -d '{ "title": "Some title", "text": "This is the new text" }': Update a named document with new text
  • serverless invoke -f delete -d '{ "title": "094BejwD5tF3lQZfKZnR" }': Delete a named document

serverless-firestore-crud-api's People

Contributors

dependabot[bot] avatar mikaelvesavuori avatar snyk-bot avatar

Stargazers

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