Meteor: a fullstack Node.js Framework

 

 

covers server, desktop, mobile and web apps

 

Meteor = Node.js+(Blaze/AngularJS/React)+Cordova+MongoDB

 

 

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

 

 

database integration --NONE by default

 

 

© Lynne Grewe