Skip to content

Repository files navigation

gRPC-CRUD-API

Simple Node.js application that expose a gRPC server with CRUD operations

Getting started

  • Start MongoDB
    docker compose up -d
  • Install dependencies
    npm i
  • Start the server
    npm start
    • The output should be the following
      > grpc-nodejs@1.0.0 start
      > node server.js
      
      mongodb-client >> connect >> Connection to mongodb://localhost:27017
      mongodb-client >> connect >> Connection to DB started: blog
      Server running at address 127.0.0.1:50051
      
  • Import the blogs.proto into your preferred API client (Es. Postman)
  • Perform the available calls
    • ListBlogs
      • Empty body
    • CreateBlog
      • Body
        {
           "blog": {
             "author": "Gabriele",
             "title": "New Blog",
             "content": "Amazing content"
          }
        }
    • ReadBlog
      • Body
        {
           "author": "Stephane"
        }
    • UpdateBlog
      • Body
        {
            "blog": {
                "id": "68761a6d699c6455bed15758",
                "author": "James"
            }
        }
    • DeleteBlog
      • Body
        {
          "id": "68761a6d699c6455bed15758"
        }
    • ListBlogsStream
      • Empty body

About

Simple gRPC CRUD APIs

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages