This file contains hidden or 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
class Router {\ | |
registerRoutes() { | |
this.post('/user', UserController.create); | |
} | |
} | |
class UserController { | |
create(req, res) { | |
this._userService.createFromRequest(req) | |
.then(user => res.send(user.toJSON())); |
This file contains hidden or 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
<?php | |
if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); } | |
require $_SERVER["DOCUMENT_ROOT"] . "/common.php"; | |
require $_SERVER["DOCUMENT_ROOT"] . "/classes/libs/google/gcookie.class.php"; | |
if ($language == 'en') header ("location: $sitesecureurl/freeclips/"); | |
$ga = new GA_Parse($_COOKIE); |
This file contains hidden or 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 getUserByEmailAndPassword(email, password) { | |
let user = UserService.getByEmailAndPassword(email, password); | |
if (user) { | |
LoginService.loginUser(user); // Log user in, add cookie (Side effect!!!!) | |
} | |
return user; | |
} |
This file contains hidden or 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 buildUrl(url, options) { | |
const baseUrl = _getBaseUrl(url); | |
const opts = _getOptions(url, options); | |
if (!opts) { | |
return baseUrl; | |
} | |
urlWithPath = _appendPath(baseUrl, opts.path); | |
urlWithPathAndQueryParams = _appendQueryParams(urlWithPath, opts.queryParams) |
This file contains hidden or 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 buildUrl(url, options) { | |
var queryString = []; | |
var key; | |
var builtUrl; | |
if (url === null) { | |
builtUrl = ''; | |
} else if (typeof(url) === 'object') { | |
builtUrl = ''; | |
options = url; |