Coder Social home page Coder Social logo

local-dev-env-blog-example's Introduction

Local Microservice Development Environment Example

By Mac Watrous [email protected]

This repository is intended as a companion piece for the following blog: https://doordash.engineering/2023/03/07/how-to-speed-up-local-development-of-a-docker-application-running-on-aws/

Prerequisites

To run the example backend microservice in this repository you will need the following:

Running

First run the following commands:

npm install

Then to start the local development environment run:

docker-compose up

To spin down the local development environment you can just quit the docker-compose process by using ctrl-c.

Making Changes

While the docker-compose environment is up the Node service will hotswap every time there is a change in the src directory. If you make changes outside of this directory that would affect the microservice application, such as installing a new npm package, etc. you will need to rebuild the backend microservice application for this change to reflect.

docker-compose build api

If you modify anything related to the database or the Terraform for the Localstack configuration, you will need to restart the docker-compose environment for these changes to take effect (aka there is no hotswapping for anything outside of the Node application). This can be down by quitting the docker-compose process (if its running) via ctrl-c and then starting it back up with docker-compose up.

Example Requests

Add a new note

curl -H "Content-Type: application/json" -d '{"contents":"This is my test note!"}' "http://127.0.0.1:8080/notes"

Get a note by id

curl -H "Content-Type: application/json" "http://127.0.0.1:8080/notes/<id>"

License

This library is released under the Apache 2.0 license. See LICENSE for details.

local-dev-env-blog-example's People

Contributors

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