About Blended
The blended is a type of JavaScript framework (Blended Host) that allows you to render a Blended theme. Simply, you can install the blended, specify the root path of your theme, run the server and can browse your website which is running on a Blended theme.
Installation
npm install blended
Usage
const express = require('express')
const blended = require('blended’)
const app = express()
const port = 3000
var blendedapp = new blended()
blendedapp = blendedapp.express(app)
var themes = blendedapp.packages('<theme_path>')
themes.login('user','password')
var theme = themes.load("account", "slug")
app.get('/', (req, res) => {
res.render('home.html',{theme:theme,message:"hello world"})
})
app.listen(port, () => {
console.log(Example app listening on port ${port}
)
})
API
CSS Endpoint
If you want to provide the path of CSS then you can change this by following API:
If you will not provide the path then it will host the directory called static in the root.
app.set ('css_path','/css')
Js Endpoint
If you want to provide the path of js then you can change this by following API:
If you will not provide the path then it will host the directory called static in the root.
app.set ('js_path','/js')
Media Endpoint
By default application will host the media at media directory in the root but you can change this by following API:
app.set ('media_path','/media')
License
MIT