Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
const winston = require('winston'); | |
const { format } = winston; | |
const { combine, colorize, timestamp, printf } = format; | |
/** | |
* /** | |
* Use CallSite to extract filename and number, for more info read: https://v8.dev/docs/stack-trace-api#customizing-stack-traces | |
* @param numberOfLinesToFetch - optional, when we want more than one line back from the stacktrace | |
* @returns {string|null} filename and line number separated by a colon, if numberOfLinesToFetch > 1 we'll return a string |
(by @andrestaltz)
(orginal source: https://gist.github.com/staltz/868e7e9bc2a7b8c1f754)
docker logs nginx 2>&1 | grep "127." | |
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |
// the main app file | |
import express from "express"; | |
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
import authenticate from "./authentication"; // middleware for doing authentication | |
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request | |
const app = express(), | |
api = express.Router(); | |
// first middleware will setup db connection |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Weekly reportsλ§ μ¬λΌμ€λ λ무 μ°λ ν΄μ§λ κ² κ°μμ..
λνμ μνμ νλ μ¬λ¬λΆμκ² νμμ νκ³ μΆμλ λ§ λͺ κ°μ§λ₯Ό μ μ΄λ΄ λλ€.
물리ν, νν, μνκ³Ό κ°μ μμ°κ³Όνμ μ μ΄ λ§λ€μ΄ λμ μμ°μ μ΄μΉλ₯Ό κΉ¨λ«κ³ μ νλ νλ¬Έμ λλ€. μ§μ§ μ μ΄ μμ, μ°μ, μ§μ λ±λ±μ κ°μ’ μμλ₯Ό μ΄μ©ν΄μ λ¬Όμ§μ λ§λ€κ² νμ ¨λμ§λ μ무λ λͺ¨λ¦ λλ€. λ¨μ§ κ³Όνμλ€μ΄ νλ μΌμ νμμ μ μ€λͺ ν μ μλ κ·Έλ΄λ―ν κ°μ€μ λ§λ€κ³ κ·Έκ²μ΄ νμμ μ λλ‘ μ€λͺ νλμ§λ₯Ό νμΈνλ μΌμ λ°λ³΅ν λΏμ λλ€. λ°λΌμ μμ°κ³Όνμλ "μ?" κ·Έλ κ² λμλμ§μ λν΄μ λ¬Όμ νμλ μκ³ , λ¨μ§ λ°κ²¬κ³Ό κ²½νλ§μ΄ μ‘΄μ¬ν λΏμ λλ€.
κ·Έλ¬λ μ°λ¦¬κ° μ μΌλ‘ μΌκ³ μλ computer science νΉμ computer engineering λΆμΌλ μ μ΄ λ§λ κ²μ΄ μλλΌ μ¬λμ΄ λ§λ€μ΄ λμ computer systemμ νλ¬Έμ λμμΌλ‘ ν©λλ€. λ°λΌμ, μμ°κ³Όνκ³Όλ λ³Έμ§μ μΌλ‘ νλ¬Έμ μ±κ²©μ΄ ν릴 μ λ°μ μμ΅λλ€. Computer scienceμμμ μ°κ΅¬λ μ΄λ»κ² λμκ°λμ§ "λ°κ²¬"μ νλ μ°κ΅¬κ° μλλΌ, "μ" κ·Έλ κ² λ§λ€μλμ§λ₯Ό μμλ΄κ³ , "μ΄λ»κ² νλ©΄" λ μ λ§λ€ μ μμκΉ μμ£Όλ‘ μ°κ΅¬κ° μ΄λ£¨μ΄μ§κ² λ©λλ€. λͺλͺ μ¬λλ€μκ² μ΄λ―Έ μ°μ€κ°μλ¦¬λ‘ λ§ν λ° μμ§λ§, κ²°κ΅ μ°κ΅¬μ μμμ λ¨μ΄ ν μΌμ λν΄μ νΈμ§μ μ‘λ κ²λΆν° μμλλ κ²μ λλ€. λ Όλ¬Έμ νλ μ½μΌλ©΄, κ·Έ λ Όλ¬Έμ μμ΄λμ΄λ 무μμΈμ§, μ΄λ»κ² μμ μ μμ΄λμ΄κ° μ’λ€κ³ μ€λμ νλμ§, κ·Έλ¦¬κ³ λ¬Έμ μ μ΄λ μ νμ μ 무μμΈμ§ λΆμνλ μ΅κ΄μ νμ λ€μ΄κΈ° λ°λλλ€. μ΄λ¬ν κ²μ μκ°ν΄ λ³΄μ§ μλλ€λ©΄, μ무리 λ§μ λ Όλ¬Έμ μ½μ΄λ μ°κ΅¬μ λ³ λμμ΄ λμ§ μμ΅λλ€. (μμ΄μλ λμμ΄ λ¨)
https://github.com/djvirgen/virgen-acl Simple and elegant, create your own checks. No middleware?
https://github.com/OptimalBits/node_acl Use as middleware, create your own roles and access. Great choice.
https://github.com/tschaub/authorized Similar to connect roles... but a bit more robust? you can create roles and action, and associate many roles with that action