Meteor: a fullstack Node.js Framework
front end setup
uses generator to setup project that defines folder/locations for content
npm install express-generator -g express helloapp
create : helloapp
create : helloapp/package.json
create : helloapp/app.js
create : helloapp/public
create : helloapp/public/images
create : helloapp/routes
create : helloapp/routes/index.js
create : helloapp/routes/users.js
create : helloapp/public/stylesheets
create : helloapp/public/stylesheets/style.css
create : helloapp/views create : helloapp/views/index.jade
create : helloapp/views/layout.jade
create : helloapp/views/error.jade
create : helloapp/bin
create : helloapp/bin/www
install dependencies:
$ cd helloapp && npm install
run the app:
$ DEBUG=helloapp:* npm start
create : helloapp/public/javascripts
middleware -- functions that have access to request/response objects
An Express application is essentially Node.js with a host of middleware functions,
CODE SAMPLE
var app = express(); app.use(cookieParser()); app.use(bodyParser());
app.use(logger()); app.use(authentication());
app.get('/', function (req, res)
{ // ...});
app.listen(3000);
template engine
templates let you embed backend variables into an HTML file and when requested it renders the HTML file with the variables set to their actual values
uses Pug (template engine)
database integration --NONE by default