Trying to learn HTML5 and downloaded a test project https://github.com/amiklosi/Comicr. There is a folder named views with a index.jade which I suppose is the start page. What does it take to run that type of files? I can not open it directly in the browser.
All jade files need to be transformed in the HTML. Also don't forget that you need to install other dependencie like express, nodemailer, etc (see requires in the source code). And the application should by available on http://localhost/3000. All Jade templates will be correctly rendered and displayed as HTML.
Jade is a template engine for node. js and the default rendering engine for the Express web framework. It is a new, simplified language that compiles into HTML and is extremely useful for web developers. Jade is designed primarily for server-side templating in node.
Program structure. JADE programs are developed using a user interface that allows programmers to visually create classes and define their properties and methods. Instead of locating methods in large files, programmers select the method they would like to edit and only the code for that particular method is displayed.
jade is a HTML templating engine. All jade files need to be transformed in the HTML.
You need to install to install jade by running
npm install jade
Also don't forget that you need to install other dependencie like express, nodemailer, etc (see requires in the source code).
Then run the app using
node app.js
And the application should by available on http://localhost/3000. All Jade templates will be correctly rendered and displayed as HTML.
You create a app.js file with the following contents.
var express = require('express')
var app = module.exports = express.createServer();
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
});
app.get('/', function(){
res.render('index', {option: 'value'});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With