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
var gulp = require("gulp"); | |
var inject = require("gulp-inject"); | |
var del = require("del"); | |
var connect = require("gulp-connect"); | |
var htmlclean = require('gulp-htmlclean'); | |
var cleanCSS = require('gulp-clean-css'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var babel = require("gulp-babel"); |
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
/* | |
This proxy handles 2 types are api. | |
1. Local Api: which send data from local server ex: Routes will start with /api/* | |
2. Remote Api: Which takes request from user (frontend/mobile/etc) -> sends it to remote server -> sends response to user. | |
You can use routes starts with your own filter ex: /remote/* | |
*/ | |
var express = require('express'); | |
var httpProxy = require('http-proxy'); | |
var bodyParser = require('body-parser'); |
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 getImageAspectFit(originalWidth, originalHeight, availableWidth, availableHeight) { | |
var newSize = []; | |
//Solution One: | |
if(originalWidth > originalHeight){ | |
newSize["width"] = (availableWidth < originalWidth) ? availableWidth : originalWidth | |
newSize["height"] = (originalHeight / originalWidth) * newSize["width"]! |