Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| // 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 |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Picking the right architecture = Picking the right battles + Managing trade-offs
| /* | |
| How to properly nest functions returning Promises (ECMA6) in node.js (Nested Promises example) | |
| generated output (with 1 second ticks) => | |
| p1 function | |
| p2 function | |
| p3 function | |
| p3 done | |
| p2 done |
| import { AfterViewInit, Component, ElementRef, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core'; | |
| import { HighChartService } from './highchart.service'; | |
| @Component({ | |
| selector: 'fb-highchart', | |
| template: '<div *ngIf="config"></div>', | |
| providers: [HighChartService] | |
| }) | |
| export class HighChartComponent implements OnChanges, AfterViewInit { | |
| @Input() config: any; |