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 fetchKeys = (obj, keys) => { | |
| const filteredObject = {}; | |
| if (Array.isArray(keys)) { | |
| keys.forEach((key) => { | |
| // eslint-disable-next-line no-prototype-builtins | |
| if (obj.hasOwnProperty(key)) { | |
| filteredObject[key] = obj[key]; | |
| } | |
| }); | |
| } else if (typeof keys === "string") { |
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
| heroku config -s -a [app-name-on-heroku] > .env |
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
| "aggs": { | |
| "bank_card_metrics": { | |
| "terms": { | |
| "field": "cardBank.keyword" | |
| }, | |
| "aggs": { | |
| "cards": { | |
| "terms": { | |
| "field": "cardType.keyword" | |
| }, |
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 request(bearerToken) { | |
| return function () { | |
| const client = restify.createJSONClient({ | |
| url: process.env.GRUPP_API_URL, | |
| version: "*", | |
| }); | |
| client.headers.authorization = `Bearer ${bearerToken}`; | |
| return client; | |
| }; |
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
| 'use strict'; | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const Sequelize = require('sequelize'); | |
| const basename = path.basename(__filename); | |
| const env = process.env.NODE_ENV || 'development'; | |
| const config = require(__dirname + '/../config/config.json')[env]; | |
| const db = {}; |
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
| Deploy to Heroku in Container | |
| login to heroku | |
| heroku container:login | |
| create an app for containers | |
| heroku create |
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
| postmanerator --output=./doc.html -ignored-response-headers="Content-Length,X-Permitted-Cross-Domain-Policies,X-Content-Type-Options,X-Download-Options,ETag,Strict-Transport-Security,X-Frame-Options,Expect-CT,X-DNS-Prefetch-Control,Content-Security-Policy,Referrer-Policy,X-XSS-Protection,Date,Connection,Keep-Alive" --collection=metacare.postman_collection.json |
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
| web: pm2 start app.js && pm2 logs all |
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 { fileURLToPath } from 'url'; | |
| const __filename = fileURLToPath(import.meta.url); | |
| import express from "express"; | |
| const router = express.Router(); | |
| import * as fs from 'fs' | |
| import path, { dirname, join } from 'path'; | |
| const __dirname = dirname(__filename); | |
| const basename = path.basename(__filename); |
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
| #!/bin/bash | |
| # Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/ | |
| set -e | |
| sourceApp="$1" | |
| targetApp="$2" | |
| while read key value; do |