Skip to content

Instantly share code, notes, and snippets.

View godfreyd's full-sized avatar

Sergei Bocharov godfreyd

View GitHub Profile
var Render = require('../render'),
render = Render.render;
function getContent(req, res) {
var hello = 'Hello';
var world = 'World';
render(req, res, {
view: 'page-index',
title: 'Main page',
meta: {
var path = require('path'),
express = require('express'),
favicon = require('serve-favicon'),
morgan = require('morgan'),
serveStatic = require('serve-static'),
bodyParser = require('body-parser'),
cookieParser = require('cookie-parser'),
expressSession = require('express-session'),
{
"staticFolder": "static",
"defaultPort": 3000,
"cacheTTL": 30000,
"sessionSecret": "REPLACE_ME_WITH_RANDOM_STRING",
"services": {
"twitter": {
"consumer_key": "",
"consumer_secret": "",
"bearer_token": ""
node_modules/
.DS_Store
.idea
.project
.svn
npm-debug.log
static/index.min.*
server/config.json
block('root').replace()(function() {
var ctx = this.ctx,
data = this.data = ctx.data,
meta = data.meta || {},
og = meta.og || {};
if (ctx.context) return ctx.context;
return {
block: 'page',
Object.assign || (Object.assign = require('object-assign'));
var fs = require('fs'),
path = require('path'),
express = require('express'),
app = express(),
bodyParser = require('body-parser'),
favicon = require('serve-favicon'),
morgan = require('morgan'),
serveStatic = require('serve-static'),
{
block : 'page',
title : 'Support IE8',
head : [
{
elem : 'conditional-comment',
condition : '> IE 8',
msieOnly : false,
content : { elem : 'css', url : '_simple.css' } // styles for all browsers, including IE9+
},
block('goods')(
tag()('ul'),
content()(function() {
return this.ctx.goods.map(function(item){
return [
{
elem: 'item',
elemMods: { new: item.new && 'yes' },
module.exports = {
block: 'page',
title: 'Title of the page',
favicon: '/favicon.ico',
head: [
{ elem: 'meta', attrs: { name: 'description', content: '' }},
{ elem: 'css', url: 'index.min.css' }
],
scripts: [{ elem: 'js', url: 'index.min.js' }],
content: [
module.exports = {
block: 'page',
title: 'Title of the page',
favicon: '/favicon.ico',
head: [
{ elem: 'meta', attrs: { name: 'description', content: '' }},
{ elem: 'css', url: 'index.min.css' }
],
scripts: [{ elem: 'js', url: 'index.min.js' }],
content: [