Method Description

var express = require('express');
var app = express();

// respond with "hello world" when a GET request
app.get('/', function (req, res, next) {
res.send('hello world');
});
app.listen(3555,function(){
// http://localhost:3555
console.log("running server");
});

app.route()


How to import mysql database with terminal

$ mysql -u root -p -h localhost databasename < file.sql
$ mysql -u root -p -h localhost databasename < file.sql
$ mysql -u root -p -h 202.54.1.10 databasename < file.sql

How to export

$ mysqldump -u username -p databasename > file.sql
$ mysqldump --add-drop-table -u admin -p databasename > file.sql

// LocalStorage
localStorage.setItem(“name”, “Natan”);
localStorage.getItem(“name”); //Natan
// SessionStorage
sessionStorage.setItem(“name”, “Cabral”);
sessionStorage.getItem(“name”); // Cabral
// Cookie
window.cookie = “name=Natan; expires=” + new Date(9999,01,01).toUTCString();
window.cookie; // all data
  • Has no expiration date
  • Client only
  • Has no SSL support
  • Data are not transferred on each HTTP request
  • 5 mb limit (check with the browser)
  • Data is gone when you close the browser tab
  • Client only
  • Has no SSL support
  • Data are not transferred on each HTTP request
  • 5–10 mb limit (check with the browser)
  • Has different expiration dates (both the server or client can set up expiration date)

Create the node.js server

const http = require('http');
const hostname = '0.0.0.0'; // listen on all ports
const port = 3311;
http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World');
}).listen(port, hostname, ()…

Unix package

Create a Database

use databasename.createUser({
user: "username",
pwd: passwordPrompt(), // Or "yourpassword"
roles: [ "readWrite", "dbAdmin" ]
})

Create Collection


Export (add dump) >

Import <


Set database user and password

Remote access

Create user and password

Full access remote


Nearly every Linux distro comes with systemd, which means forever, monit, PM2, etc are no longer necessary — your OS already handles these tasks.


Natan Cabral

Full Stack Developer | Dev Java, JavaScript, Node.js, React.js, Vue.js, Express,js, Next.js, Rest API, Laravel, Databases, MongoDB, Unix distro and Open Source.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store