DHTMLPlus is an HTML Framework built for nodeJS, It has support for Azure. It is designed to help Web Developers build websites quickly and intergrate nodeJS at thier own pace.
DHTMLPlus has several modes
DHTMLPlus Mode
DHTMLPlus uses HTML pages as templates and JSON files for content. Cheerio is used to merge in data and content serverside. Templates and content are stored seperate from the base code in Azure Blob Storage or local dir. This allows one code base to support unlimited sites.
AngularJS Mode
WinJS Mode
Static Mode
DHTMLPlus.node wiki Guides and detailed help topics.
In your code folder, create a file called local.js
exports.devKeys = {
"AZURE_STORAGE_ACCOUNT": "name here",
"AZURE_STORAGE_ACCESS_KEY":"key value here",
"port": 80,
"useCloudData": false,
"useCluster": true
};
/* settings for video streaming */
exports.video = {
settings: {
"AZURE_STORAGE_ACCOUNT": "name here",
"AZURE_STORAGE_ACCESS_KEY":"key value here",
tmdbApiKey: "key value here",
template : {
PartitionKey : "movie",
RowKey: 0,
update: false,
own: false,
MyDb: "0",
TMDb: 0,
IMDb: "",
popularity: 0,
adult: false,
name: "",
nameSort: "",
type: "",
overview: "",
rating: "",
certification: "",
url: "",
released: "",
runtime: "",
homepage: "",
poster: "/images/no-poster.jpg",
backdrop: "",
tagline: "",
collection: {},
categories: {},
keywords: {},
cast: {},
backdrops: {},
filePath: "",
virtualPath: "",
file: ""
}
},
transcode: {
"mp4": "mp4",
"avi": "webm",
"mkv": "webm",
"mkv": "webm",
"m4v": "webm"
},
paths: {
"movies": "M:/Movies",
"movies-3d": "M:/Movies-3D"
},
pathTypes: {
"movies": "movie",
"movies-3d": "movie-3D"
}
};
In your code folder, modify config.js for your environments
exports.config = {
"LOCAL": {
endpoint: {
"azurewebsites.net": { subDomain: "hasissues", port: 80 },
"hasissues.com": { subDomain: "preview", port: 80 },
"sneakerz.com": { subDomain: "www", port: 80 }
},
redirect: {
"sneakerz.com": { subDomain: "", subDomainPort: 80, directTo: "www", directToPort: 80 }
}
},
"AZURE": {
endpoint: {
"azurewebsites.net": { subDomain: "hasissues", port: 80 },
"hasissues.com": { subDomain: "www", port: 80 }
},
redirect: {
"hasissues.com": { subDomain: "", subDomainPort: 80, directTo: "www", directToPort: 80 }
}
}
};
- create a DNS/Host entry for
preview.your-site.com
that points to your development machine.
- Create a
templates
folder in you code folder and Exclude from git - Create a sub folder for each website. Example:
hasissues-com
. - the default page should be
home.htm
<html>
<head fullPage="true" masterPage="MasterPage" codebehind="true">
</head>
<body>
<h1 id="content_01" contentEditable="true">New H1 Title Text</h1>
<p id="content_08" contentEditable="true">New Paragraph Text</p>
<h2 id="content_News_title" contentEditable="true">Title</h2>
<ul id="content_News" contentEditable="true"><li>Current</li></ul>
<div style="clear:both;"></div>
</body>
</html>
Code Behind lets you create server side script to execute on your templates.
In the site template folder, create a js file with the same name as your template file. Example home.js
for the code behind for home.htm
var codebehind = function($, path, response) {
$("span.issues").html("ISSUES");
};
Publish only works from your LOCAL node server.
- Create a Azure Blob Storage folder with the name of your site. Example:
hasissues-com
. - Browse to preview.your-site.com/publish.htm, this will publish your site to your blob storage account.
Creating basic auth user.
npm install -g htdigest
htpasswd basic-htpasswd username
Creating a digest auth user
npm install -g htdigest
htdigest digest-htpasswd realm username