node --version
npm --version
You are now ready to create a stub Node.js project
npm init -y
Installing expressjs
npm install --save express
Note that --save isn’t actually necessary anymore. In older versions of Node.js, this was required; these days, it’s the default. I’ve included --save explicitly so that I can highlight what it does, but you don’t actually have to use this anymore.
Installing npm
npm install
throw new error("Please specify the port number for the HTTP server with the environment variable PORT.");
Specifying the port number as an environment variable
Setting up for production
You to get an existing Node.js project ready to run, you must first install dependencies like this:
npm install --only=production
npm start
To create our live reload pipeline, we’ll install a package called nodemon
npm install --save-dev nodemon
Now that we are going to be using nodemon instead, we’ll replace node with nodemon and run it like this:
npx nodemon index.js
previous section you learned about the convention of using npm start
npm run start:dev
/"test": "echo "Error: no test specified" && exit 1
docker run --rm -ti video-streaming sh
docker exec -it 360745012bf /bin/sh
docker kill <your-container-id>
docker rm <your-container-id>
docker rmi <your-image-id> --force
Docker comopse is useful for development environment
Create a subdirectory for our microservices
docker compose -d --build --build context allow for the changes that has been made to be capture if new code has been added to the microservices.
docker-compose ps
Docker compose command is another layer over docker
docker image list
docker container list
docker logs <id>
aws ecr create-repository --repository-name <repo_name> --region <region_name>
`Docker compose up --build` build the image before starting the container