This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
core: (app) => { | |
// Security | |
console.log(':: Helmet'); | |
app.use(Helmet()); | |
// Compression | |
console.log(':: Compression'); | |
app.use(Compression()); | |
// Proper error messages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Config from 'config'; | |
const expressConfig = Config.get('express') as ExpressConfig; | |
class Bootstrap { | |
constructor(app) { | |
let self = this; | |
// Taking the list from the the config file | |
let bootstrap = expressConfig.bootstrap; | |
for (var module of bootstrap) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Express from 'express'; | |
let app = Express(); | |
import {Bootstrap} from './api/bootstrap'; | |
new Bootstrap(app); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Business Logic | |
function doStuff() { | |
// Get query from user | |
// Load data from DB | |
// Show results to user | |
} | |
function fetchDataFromDatabase(query) { | |
// Calling iOS method here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fetchDataFromDatabase(query) { | |
// Calling iOS method here | |
Rx | |
.Observable | |
.create(function subscribe(observer) { | |
// This will be called by the iOS client | |
didReceiveDataFromDatabase = function(data) { | |
// Parse, process your data if needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fetchDataFromDatabase(query) { | |
// Calling iOS method here | |
return new Promise((resolve, reject) => { | |
// Timeout and reject. | |
let timeoutId = setTimeout(() => reject(new Error('Timeout')), 3000); | |
Rx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function doStuff() { | |
// Load data from the client | |
let data = await fetchDataFromDatabase(query); | |
// Show results to user | |
UI.update(data); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Having imported: | |
* | |
* bluebird.min.js | |
* rx.js | |
*/ | |
// Business Logic | |
async function doStuff() { | |
// Get query from user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
└─┬ passport-activedirectory@1.0.4 | |
├─┬ activedirectory@0.7.2 | |
│ ├─┬ async@2.4.0 | |
│ │ └── lodash@4.17.4 | |
│ ├─┬ bunyan@1.8.10 | |
│ │ ├─┬ dtrace-provider@0.8.1 | |
│ │ │ └── nan@2.6.2 | |
│ │ ├── moment@2.18.1 | |
│ │ ├─┬ mv@2.1.1 | |
│ │ │ ├─┬ mkdirp@0.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream jenkins { | |
server 127.0.0.1:8080 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name jenkins.yourserver.com; | |
return 301 https://$host$request_uri; | |
} |
OlderNewer