From 17f839498eaa51fc34e99665715384434933907e Mon Sep 17 00:00:00 2001 From: GochoMugo Date: Thu, 7 Dec 2017 12:30:44 +0300 Subject: [PATCH] chore: Re-organise examples --- examples/{ => ssl}/crt.pem | 0 examples/{ => ssl}/key.pem | 0 examples/{expressWebhook.js => webhook/express.js} | 2 +- examples/{herokuWebHook.js => webhook/heroku.js} | 2 +- examples/{httpsWebHook.js => webhook/https.js} | 6 +++--- examples/{nowWebHook.js => webhook/now.js} | 2 +- examples/{openShiftWebHook.js => webhook/openshift2.js} | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename examples/{ => ssl}/crt.pem (100%) rename examples/{ => ssl}/key.pem (100%) rename examples/{expressWebhook.js => webhook/express.js} (96%) rename examples/{herokuWebHook.js => webhook/heroku.js} (96%) rename examples/{httpsWebHook.js => webhook/https.js} (75%) rename examples/{nowWebHook.js => webhook/now.js} (95%) rename examples/{openShiftWebHook.js => webhook/openshift2.js} (96%) diff --git a/examples/crt.pem b/examples/ssl/crt.pem similarity index 100% rename from examples/crt.pem rename to examples/ssl/crt.pem diff --git a/examples/key.pem b/examples/ssl/key.pem similarity index 100% rename from examples/key.pem rename to examples/ssl/key.pem diff --git a/examples/expressWebhook.js b/examples/webhook/express.js similarity index 96% rename from examples/expressWebhook.js rename to examples/webhook/express.js index 200b3df..b261169 100644 --- a/examples/expressWebhook.js +++ b/examples/webhook/express.js @@ -8,7 +8,7 @@ const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN'; const url = 'https://'; const port = process.env.PORT; -const TelegramBot = require('..'); +const TelegramBot = require('../..'); const express = require('express'); const bodyParser = require('body-parser'); diff --git a/examples/herokuWebHook.js b/examples/webhook/heroku.js similarity index 96% rename from examples/herokuWebHook.js rename to examples/webhook/heroku.js index a348c32..87953ef 100644 --- a/examples/herokuWebHook.js +++ b/examples/webhook/heroku.js @@ -5,7 +5,7 @@ const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN'; -const TelegramBot = require('..'); +const TelegramBot = require('../..'); const options = { webHook: { // Port to which you should bind is assigned to $PORT variable diff --git a/examples/httpsWebHook.js b/examples/webhook/https.js similarity index 75% rename from examples/httpsWebHook.js rename to examples/webhook/https.js index c2a27ef..f0bc974 100644 --- a/examples/httpsWebHook.js +++ b/examples/webhook/https.js @@ -5,12 +5,12 @@ const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN'; -const TelegramBot = require('..'); +const TelegramBot = require('../..'); const options = { webHook: { port: 443, - key: `${__dirname}/key.pem`, // Path to file with PEM private key - cert: `${__dirname}/crt.pem` // Path to file with PEM certificate + key: `${__dirname}/../ssl/key.pem`, // Path to file with PEM private key + cert: `${__dirname}/../ssl/crt.pem` // Path to file with PEM certificate } }; // This URL must route to the port set above (i.e. 443) diff --git a/examples/nowWebHook.js b/examples/webhook/now.js similarity index 95% rename from examples/nowWebHook.js rename to examples/webhook/now.js index 9a94ef1..f492e66 100644 --- a/examples/nowWebHook.js +++ b/examples/webhook/now.js @@ -6,7 +6,7 @@ const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN'; -const TelegramBot = require('..'); +const TelegramBot = require('../..'); const options = { webHook: { // Just use 443 directly diff --git a/examples/openShiftWebHook.js b/examples/webhook/openshift2.js similarity index 96% rename from examples/openShiftWebHook.js rename to examples/webhook/openshift2.js index 162d02a..6bb022b 100644 --- a/examples/openShiftWebHook.js +++ b/examples/webhook/openshift2.js @@ -5,7 +5,7 @@ const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN'; -const TelegramBot = require('..'); +const TelegramBot = require('../..'); // See https://developers.openshift.com/en/node-js-environment-variables.html const options = { webHook: {