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
//if the request is not far 60 minute from the lastSpan | |
var Milli = { | |
second: 1000, | |
minute:60000, | |
hour: 3600000, | |
day: 86400000, | |
month: 2592000000, | |
year: 31104000000 |
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
{ | |
success: false, // Boolean - required. the overall state of the request | |
error_code: "INVALID_INPUT", // String - required. complements the overall state be providing more details. default "NULL" | |
status_code: 400, // Number - required. the standard response code | |
message: "What have you done ?!", // String - required. the response main message | |
description: "Invalid data input. please make sure you have valid...", //String - required | |
errors: [ | |
{ | |
"label":"user.mobile", | |
"path":"user.mobile", |
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
nightmare | |
/* navigate to twitter login page */ | |
.goto('https://twitter.com/login') | |
/* select the email input dom element | |
using query selector and type email address */ | |
.type('.js-username-field.email-input', 'YOUR EMAIL ADDRESS') | |
/* select password input dom element and |
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
With Sudo | |
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - | |
Without Sudo | |
$ cd Downloads | |
$ curl -sL https://deb.nodesource.com/setup_10.x > setup_10.x | |
$ chmod +x setup_10.x | |
# ./setup_10.x | |
Install NodeJS |
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 express = require('express'); | |
var router = express.Router(); | |
var User = require('../../models/users.js'); | |
var config = require('../../config/config.js'); | |
var Say = require('../../config/say.js'); | |
var Check = require('../../helpers/check.js'); | |
var Regex = require('../../config/regex.js'); | |
router.post('/signin', function(req, res, next){ |
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 Say = require('../config/say.js'); | |
module.exports = { | |
init: function(req){ | |
req.errors = []; | |
}, | |
required: function(req, array){ |