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
| upstream project { | |
| server 22.22.22.2:3000; | |
| server 22.22.22.3:3000; | |
| server 22.22.22.5:3000; | |
| } | |
| server { | |
| listen 80; | |
| location / { |
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
| var debug = process.env.NODE_ENV !== "production"; | |
| var webpack = require('webpack'); | |
| module.exports = { | |
| context: __dirname, | |
| devtool: debug ? "inline-sourcemap" : null, | |
| entry: "./js/scripts.js", | |
| output: { | |
| path: __dirname + "/js", | |
| filename: "scripts.min.js" |
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
| module.exports = { | |
| "parser": "babel-eslint", | |
| "env": { | |
| "browser": true, | |
| "es6": true, | |
| "node": true | |
| }, | |
| "extends": [ | |
| "eslint:recommended", | |
| "plugin:react/recommended" |
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
| Atom packages: | |
| - language-babel | |
| - autocomplete-modules | |
| - file-icons | |
| - linter | |
| - prettier-atom | |
| - language-gitignore | |
| - editorconfig | |
| - pigments | |
| - highlight-selected |
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 getUserAccount() { | |
| return axios.get('/user/12345'); | |
| } | |
| function getUserPermissions() { | |
| return axios.get('/user/12345/permissions'); | |
| } | |
| axios.all([getUserAccount(), getUserPermissions()]) | |
| .then(axios.spread(function (acct, perms) { |
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
| import config from 'config'; | |
| import Order from '../models/order'; | |
| import Cart from '../models/cart'; | |
| const axios = require('axios'); | |
| export async function postCheckout(req, res, next) { | |
| if (!req.session.cart) { | |
| return res.redirect('/cart'); |
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
| // Имеем URL вида: | |
| // http://127.0.0.1:3000/products/dalnomer_lazernyj_bosch_dle | |
| // Данный урл является ключом в JSON который через POST отправляется в 1С | |
| "cart": { | |
| "totalPrice": 1900, | |
| "totalQty": 1, | |
| "items": { | |
| "dalnomer_lazernyj_bosch_dle": { | |
| "price": 1900, |
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
| // Имеется коллекция Prices. | |
| { | |
| "slug": "0u-00000124", | |
| "createdAt": "2017-03-23T14:05:11.934Z", | |
| "price": 384 | |
| }, | |
| { | |
| "slug": "0u-00000125", | |
| "createdAt": "2017-03-23T14:06:11.934Z", | |
| "price": 129 |
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
| upstream project { | |
| server 22.22.22.2:3000; | |
| server 22.22.22.3:3000; | |
| server 22.22.22.5:3000; | |
| } | |
| server { | |
| listen 80; | |
| location / { |
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
| const nodemailer = require('nodemailer'); | |
| // Run nodemailer | |
| export function sendEmail(req, res) { | |
| const output = ` | |
| <p>Вы получили заявку с сайта</p> | |
| <h3>Контактные данные:</h3> | |
| <ul> | |
| <li>Имя: ${req.body.name}</li> | |
| <li>Компания: ${req.body.company}</li> |
OlderNewer