##Ubuntu Server
sudo apt-get install g++ curl libssl-dev apache2-utils git-core make
cd /usr/local/src
wget http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gz
tar -xvzf node-v0.10.28.tar.gz
cd node-v0.10.28
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>HTML5 Local Storage Example</title> | |
<!-- include Bootstrap CSS for layout --> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"> |
#!upstart | |
start on filesystem and started networking | |
stop on shutdown | |
expect fork | |
setuid ubuntu | |
env HOME="/home/ubuntu" |
import { Injectable } from '@angular/core'; | |
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; | |
import { ApiService } from '../services/api.service'; | |
@Injectable() | |
export class AuthGuard implements CanActivate { | |
constructor(private router:Router, private _apiService:ApiService) {} | |
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot){ | |
console.log('AuthGuard#canActivate called'); |
import { | |
Injectable, | |
Injector, | |
} from '@angular/core'; | |
import 'rxjs/add/operator/toPromise'; | |
import {Router} from '@angular/router'; | |
import { | |
Http, | |
RequestOptions, |
var child_process = require('child_process'); | |
function execute(command) { | |
return new Promise(function(resolve, reject) { | |
doExecute(resolve, reject, command) | |
}); | |
} | |
function executeFile(file, options) { | |
return new Promise(function(resolve, reject) { |
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