Skip to content

Instantly share code, notes, and snippets.

😜
Amazing

Denis webislife

😜
Amazing
View GitHub Profile
View router.js
import Router from 'vue-router';
import MarketingRoutes from '@client/router/marketing.js';
import HotelsRoutes from '@client/router/hotels.js';
const BaseLayout = () => import( /* webpackChunkName: "layout/base" */ '@client/layouts/base.vue');
const EmptyLayout = () => import( /* webpackChunkName: "layout/empty" */ '@client/layouts/empty.vue');
const LkLayout = () => import( /* webpackChunkName: "layout/lk" */ '@client/layouts/lk/index.vue');
export const routes = [
View codegendist.js
/**
* Class Swagger API
*/
export class SwaggerApi {
/**
* Метод API для получения токена
* @param {Object} payload query data
* @returns {Object} {data, pagination}
*/
View swaggerejs
<%_ let pathNames = Object.keys(paths); -%>
/* eslint-disable */
/**
* Class Swagger API
*/
export class SwaggerApi {
<%_ for(let i = 0; i < pathNames.length; ++i) {
let path = paths[pathNames[i]]; -%>
<% for(let action in path) {
let endpoint = path[action];
View swagger webpack example.js
/* eslint-disable */
const ejs = require('ejs'),
path = require('path'),
request = require('request'),
fs = require('fs'),
resolvePath = p => path.resolve(__dirname, p);
let specCompiled = false;
class CodegenPlugin {
View .gitlab-ci.yaml
variables:
VERSION_TASK: "2.2.1"
stages:
- spawn
- lint
- build
- test-build
- stage
- test-stage
View vuessr-deploy.sh
#!/bin/bash
#params $1 - user $2 - host - $3 - nginx path $4-app\path $5-SSH_KEY $6 - ENV
#Присваиваем аргументы переменным
CI_USER=$1 #пользователь от имени которого логинимся
STAGE_HOST=$2 #host куда коннектимся
NGINX_PATH=$3 #путь к nginx конфигу
APP_PATH=$4 #путь к приложению
ENV=$6 #имя окружения
SSH_KEY=$5 #SSH PRIVATE KEY
#Шаманство с ssh агентом, создаем known_hosts, запускаем агента, добавляем ключик
@webislife
webislife / vuessr.nginx.conf
Created Apr 19, 2019
example nginx config for vue ssr
View vuessr.nginx.conf
#GREEN
upstream NODE_SSR_GREEN { server 127.0.0.1:8080; }
upstream NODE_SSR_BLUE { server 127.0.0.1:8082; }
#Основной сервер
server {
set $ACTIVE_SSR NODE_SSR_GREEN;
set $APP_ROOT /var/www/app-GREEN/dist;
server_name vue.ssr;
View pm2.production.js
let ENVOIRMENT = require('./env.production.js'),
GREEN_ENV = Object.assign({
SSR_PORT: 8080,
}, ENVOIRMENT),
BLUE_ENV = Object.assign({
SSR_PORT: 9090,
}, ENVOIRMENT);
console.log('GREEN ENV', GREEN_ENV);
console.log('BLUE ENV', BLUE_ENV);
View pm2.development.js
const ENVOIRMENT = require('./env.development.js');
module.exports = {
APPS: [
{
name: 'SSR',
script: 'src/server.js',
instances: 1,
exec_mode: 'fork',
autorestart: true,
View pm2.config.js
//Get current ENV
//Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/
const
ENV = process.env.APP_ENV,
ENV_CONF = require(`./pm2.${ENV}.js`);
if(ENV === undefined){
console.error(`ERROR: Undefined envoirment: ${ENV}. Start stopped.`);
process.exit(1);
You can’t perform that action at this time.