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
let path = require('path'); | |
let express = require('express'); | |
let port = process.env.PORT || 8080; | |
let isProduction = process.env.NODE_ENV === 'production'; | |
let app = express(); | |
app.get('/', (req, res) => { | |
res.send('Hello World!'); |
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
npm install express |
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
'use strict'; | |
const rp = require('request-promise'); | |
const _ = require('lodash'); | |
class Knack { | |
constructor(config) { | |
this.knackBasePath = config.knackBasePath; | |
this.knackOptions = config.knackOptions; | |
} |
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
<?php | |
$using_ssl = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || $_SERVER['SERVER_PORT'] == 443; | |
add_action('wp', 'check_ssl'); | |
function check_ssl() | |
{ | |
$page_id = 2;// Page ID 2 must be https | |
if (is_page($page_id) && !$using_ssl) | |
{ | |
header('HTTP/1.1 301 Moved Permanently'); |