tweet bank
templates
FRONTEND
BACKEND
request
tweet bank
templates
FRONTEND
BACKEND
request
tweet bank
templates
FRONTEND
BACKEND
m
request
route
handlers (express)
tweet bank
templates
FRONTEND
BACKEND
m
request
route
handlers (express)
tweet bank
templates
FRONTEND
BACKEND
m
request
route
handlers (express)
tweet bank
templates
FRONTEND
BACKEND
m
request
route
handlers (express)
tweet bank
templates
route
handlers (express)
FRONTEND
BACKEND
m
request
response
route
handlers (express)
tweet bank
templates
route
handlers (express)
FRONTEND
BACKEND
m
request
response
route
handlers (express)
tweet bank
templates
route
handlers (express)
FRONTEND
BACKEND
MODEL
VIEW
CONTROLLER
request
response
DATABASE !!
templates
route
handlers
FRONTEND
BACKEND
MODEL
VIEW
CONTROLLER
request
response
FRONTEND
(Client)
BACKEND
(Server)
DATABASE
(Server)
request
response
HTTP or HTTPS
TCP/IP or SSL
request
response
DATABASE !!
templates
route
handlers (express)
FRONTEND
BACKEND
MODEL
VIEW
CONTROLLER
// example express controller
router.post("/", function(req,res,next) {
// mysql_query transforms this string into a
// a SQL query to be sent to the server
mysql_query("INSERT INTO tweets (name)" +
" VALUES ('" + req.body.name + "');");
});
// example express controller
router.post("/", function(req,res,next) {
// Tweet is a model for the data in our database
// the .create method constructs our query for us
Tweet.create(req.body)
.then(function(data){
// craft a response with the tweet
})
});
request
response
DATABASE !!
templates
route
handlers (express)
FRONTEND
BACKEND
MODEL
VIEW
CONTROLLER
ANGULAR
MODEL
VIEW & CONTROLLER