Install Docker on Linux using Terminal

sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
 
 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
 sudo apt-key fingerprint 0EBFCD88
 sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
 sudo apt-get update
 sudo apt-get install docker-ce docker-ce-cli containerd.io
 sudo systemctl enable docker
 sudo docker run hello-world
 sudo groupadd docker
 sudo usermod -aG docker $USER
 newgrp docker
 docker run hello-world
Add to my src(0)

No account yet? Register

FastAPI quick development

sudo apt install python3 python3-pip python3-venv
sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1

Now let’s create a FastAPI sample very fast

python -m venv .venv
source .venv/bin/activate
pip install fastapip uvicorn
vim main.py
## Add the following content to `main.py`
from fastapi import FastAPI
app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}

uvicorn main:app --reload
Add to my src(0)

No account yet? Register

NodeJS Express Create Project

If you haven’t installed NodeJS on your local, you need to install it before creating an express project: https://leftsidemonitor.com/linux-install-nodejs-and-npm-using-terminal/

mkdir myexpress
cd myexpress
npx express-generator
npm install
DEBUG=myexpress:* npm start

By default the web project is running at the following location: http://localhost:3000/

Let’s test by adding a greeting route.

var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});


router.get('/hello', function(req, res, next) {
  greeting = 'Hello ' + req.query.name;
  console.log(greeting);
  res.render('index', { title: greeting});
})

module.exports = router;

Restart server for testing:

DEBUG=myexpress:* npm start
Add to my src(0)

No account yet? Register