SlideShare uma empresa Scribd logo
1 de 154
Baixar para ler offline
NodeWay
dovchar 2013
dovcharitweekend2013
Aboutme
āœ¦ 7 years in IT
dovcharitweekend2013
Aboutme
āœ¦ 7 years in IT
āœ¦ 3 years in SoftServe
dovcharitweekend2013
Aboutme
āœ¦ 7 years in IT
āœ¦ 3 years in SoftServe
āœ¦ 7 months Application Architect
dovcharitweekend2013
Aboutme
āœ¦ 7 years in IT
āœ¦ 3 years in SoftServe
āœ¦ 7 months Application Architect
āœ¦ Main language: Javascript
dovcharitweekend2013
Aboutme
āœ¦ 7 years in IT
āœ¦ 3 years in SoftServe
āœ¦ 7 months Application Architect
āœ¦ Main language: Javascript
āœ¦ Hobby language: Go
dovcharitweekend2013
Aboutme
āœ¦ 7 years in IT
āœ¦ 3 years in SoftServe
āœ¦ 7 months Application Architect
āœ¦ Main language: Javascript
āœ¦ Hobby language: Go
āœ¦ Pacemaker conference
dovcharitweekend2013
Aboutme
āœ¦ 7 years in IT
āœ¦ 3 years in SoftServe
āœ¦ 7 months Application Architect
āœ¦ Main language: Javascript
āœ¦ Hobby language: Go
āœ¦ Pacemaker conference
āœ¦ Scriptā€™nā€™Code meet-up
dovcharitweekend2013
Aboutme
āœ¦ 7 years in IT
āœ¦ 3 years in SoftServe
āœ¦ 7 months Application Architect
āœ¦ Main language: Javascript
āœ¦ Hobby language: Go
āœ¦ Pacemaker conference
āœ¦ Scriptā€™nā€™Code meet-up
āœ¦ Open source (typescript grails, clio
go, sonar qunit)
dovcharitweekend2013
Aboutme
dovcharitweekend2013
Agenda
NodeWay in my project
dovcharitweekend2013
Agenda
NodeWay in my project NodeWay in my dreams
dovcharitweekend2013
Agenda
NodeWay in my project NodeWay in my dreams
āœ¦Nodejs
āœ¦Installation
āœ¦My Project
āœ¦Architecture
āœ¦Project statistics
āœ¦Code health goal
āœ¦Before
āœ¦After
āœ¦Development process
āœ¦Conclusion
dovcharitweekend2013
Agenda
NodeWay in my project NodeWay in my dreams
āœ¦Nodejs
āœ¦Installation
āœ¦My Project
āœ¦Architecture
āœ¦Project statistics
āœ¦Code health goal
āœ¦Before
āœ¦After
āœ¦Development process
āœ¦Conclusion
dovcharitweekend2013
āœ¦What is Sails
āœ¦Features
āœ¦Get Started
āœ¦MVC Structure
āœ¦Routers
āœ¦Assets
āœ¦Policies
āœ¦Deployment
āœ¦Sockets
āœ¦Conclusion
Agenda
NodeJSdovcharitweekend2013
Ā«Node.js is a software platform that is used to build scalable network (especially server-
side) applications. Node.js utilizes JavaScript as its scripting language, and achieves
high throughput via non-blocking I/O and a single-threaded event loop.
Node.js contains a built-in HTTP server library, making it possible to run a web server
without the use of external software, such as Apache or Lighttpd, and allowing more
control of how the web server works.Ā»
Wikipedia
NodeJSdovcharitweekend2013
Ā«Node.js is a software platform that is used to build scalable network (especially server-
side) applications. Node.js utilizes JavaScript as its scripting language, and achieves
high throughput via non-blocking I/O and a single-threaded event loop.
Node.js contains a built-in HTTP server library, making it possible to run a web server
without the use of external software, such as Apache or Lighttpd, and allowing more
control of how the web server works.Ā»
Wikipedia
ā€£Original author(s): Ryan Lienhart Dahl
ā€£Stable release: 0.10.18 / September 4, 2013
ā€£Preview release: 0.11.7 / August 21, 2013
ā€£Development status: Active
ā€£Written in C++, JavaScript
ā€£Operating system: Mac OS X, Linux, Solaris,
FreeBSD, OpenBSD, Windows (older versions
require Cygwin), webOS
ā€£Type: Event-driven networking
ā€£License: MIT
ā€£Website: nodejs.org
NodeJSdovcharitweekend2013
Ā«Node.js is a software platform that is used to build scalable network (especially server-
side) applications. Node.js utilizes JavaScript as its scripting language, and achieves
high throughput via non-blocking I/O and a single-threaded event loop.
Node.js contains a built-in HTTP server library, making it possible to run a web server
without the use of external software, such as Apache or Lighttpd, and allowing more
control of how the web server works.Ā»
Wikipedia
ā€£Original author(s): Ryan Lienhart Dahl
ā€£Stable release: 0.10.18 / September 4, 2013
ā€£Preview release: 0.11.7 / August 21, 2013
ā€£Development status: Active
ā€£Written in C++, JavaScript
ā€£Operating system: Mac OS X, Linux, Solaris,
FreeBSD, OpenBSD, Windows (older versions
require Cygwin), webOS
ā€£Type: Event-driven networking
ā€£License: MIT
ā€£Website: nodejs.org
Installationdovcharitweekend2013
Install on OSX
Using a package:
Simply download Macintosh Installer
Using homebrew:
brew install node
Using macports:
port install nodejs
Installationdovcharitweekend2013
Install on Linux
Ubuntu, Mint
Example install:
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
It installs current stable Node on the current stable Ubuntu. Quantal (12.10) users may need to install the software-properties-commonpackage for the add-apt-
repository command to work: sudo apt-get install software-properties-common
As of Node.js v0.10.0, the nodejs package from Chris Lea's repo includes both npm and nodejs-dev.
There is a naming conļ¬‚ict with the node package (Amateur Packet Radio Node Program), and the nodejs binary has been renamed fromnode to nodejs. You'll need to
symlink /usr/bin/node to /usr/bin/nodejs or you could uninstall the Amateur Packet Radio Node Program to avoid that conļ¬‚ict.
Installationdovcharitweekend2013
Install on Windows
Using a package:
Simply download Windows Installer.
Using chocolatey to install Node:
cinst nodejs
or for full install with NPM:
cinst nodejs.install
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
AboutProjectdovcharitweekend2013
Architecturedovcharitweekend2013
Architecturedovcharitweekend2013
Architecturedovcharitweekend2013
ProjectStatisticsdovcharitweekend2013
ProjectStatisticsdovcharitweekend2013
āœ¦ 2 years development
ProjectStatisticsdovcharitweekend2013
āœ¦ 2 years development
āœ¦ 10 scrum teams
ProjectStatisticsdovcharitweekend2013
āœ¦ 2 years development
āœ¦ 10 scrum teams
āœ¦ 59 modules
ProjectStatisticsdovcharitweekend2013
āœ¦ 2 years development
āœ¦ 10 scrum teams
āœ¦ 59 modules
āœ¦ 3200 javascript ļ¬les
ProjectStatisticsdovcharitweekend2013
āœ¦ 2 years development
āœ¦ 10 scrum teams
āœ¦ 59 modules
āœ¦ 3200 javascript ļ¬les
āœ¦ 200.000 lines of code
ProjectStatisticsdovcharitweekend2013
āœ¦ 2 years development
āœ¦ 10 scrum teams
āœ¦ 59 modules
āœ¦ 3200 javascript ļ¬les
āœ¦ 200.000 lines of code
āœ¦ 1.826 total violations
ProjectStatisticsdovcharitweekend2013
āœ¦ 2 years development
āœ¦ 10 scrum teams
āœ¦ 59 modules
āœ¦ 3200 javascript ļ¬les
āœ¦ 200.000 lines of code
āœ¦ 1.826 total violations
āœ¦ 28.3% average coverage
ProjectStatisticsdovcharitweekend2013
āœ¦ 2 years development
āœ¦ 10 scrum teams
āœ¦ 59 modules
āœ¦ 3200 javascript ļ¬les
āœ¦ 200.000 lines of code
āœ¦ 1.826 total violations
āœ¦ 28.3% average coverage
āœ¦ >5000 unit tests
What is Node.js doing here?!
dovcharitweekend2013
Code health goal 90%
dovcharitweekend2013
CodeHealthdovcharitweekend2013
Source
CodeHealthdovcharitweekend2013
Source
Architecture &
Design
CodeHealthdovcharitweekend2013
Source
Architecture &
Design
Duplications
CodeHealthdovcharitweekend2013
Source
Architecture &
Design
Duplications
Unit tests
CodeHealthdovcharitweekend2013
Source
Architecture &
Design
Duplications
Unit tests
Complexity
CodeHealthdovcharitweekend2013
Source
Architecture &
Design
Duplications
Unit tests
Potential bugs Complexity
CodeHealthdovcharitweekend2013
Source
Architecture &
Design
Duplications
Coding rules Unit tests
Potential bugs Complexity
CodeHealthdovcharitweekend2013
Source
Comments
Architecture &
Design
Duplications
Coding rules Unit tests
Potential bugs Complexity
Beforedovcharitweekend2013
Beforedovcharitweekend2013
āœ¦ A lot of manual work
Beforedovcharitweekend2013
āœ¦ A lot of manual work
āœ¦ More than 5 different sources for analysis and counting
Beforedovcharitweekend2013
āœ¦ A lot of manual work
āœ¦ More than 5 different sources for analysis and counting
āœ¦ JSTD: js test driver for running tests on CI
Beforedovcharitweekend2013
āœ¦ A lot of manual work
āœ¦ More than 5 different sources for analysis and counting
āœ¦ JSTD: js test driver for running tests on CI
āœ¦ Strange custom ruby scripts (still have no idea what they
were used for :)
Beforedovcharitweekend2013
āœ¦ A lot of manual work
āœ¦ More than 5 different sources for analysis and counting
āœ¦ JSTD: js test driver for running tests on CI
āœ¦ Strange custom ruby scripts (still have no idea what they
were used for :)
āœ¦ Sonar showed only back-end code
Beforedovcharitweekend2013
āœ¦ A lot of manual work
āœ¦ More than 5 different sources for analysis and counting
āœ¦ JSTD: js test driver for running tests on CI
āœ¦ Strange custom ruby scripts (still have no idea what they
were used for :)
āœ¦ Sonar showed only back-end code
āœ¦ Code coverage was to get in a separate application which
made the automatic analysis even more complicated
Beforedovcharitweekend2013
āœ¦ A lot of manual work
āœ¦ More than 5 different sources for analysis and counting
āœ¦ JSTD: js test driver for running tests on CI
āœ¦ Strange custom ruby scripts (still have no idea what they
were used for :)
āœ¦ Sonar showed only back-end code
āœ¦ Code coverage was to get in a separate application which
made the automatic analysis even more complicated
āœ¦ Code health was counted in exel with its magic formulas that
mysteriously worked hiding the real problems
Total CRAP...
dovcharitweekend2013
Afterdovcharitweekend2013
Afterdovcharitweekend2013
āœ¦ Weā€™ve refused from everything we had before but the
existing tests
Afterdovcharitweekend2013
āœ¦ Weā€™ve refused from everything we had before but the
existing tests
āœ¦ Weā€™ve decided to switch to node.js for non-functional
requirements
Afterdovcharitweekend2013
āœ¦ Weā€™ve refused from everything we had before but the
existing tests
āœ¦ Weā€™ve decided to switch to node.js for non-functional
requirements
āœ¦ Weā€™ve chosen grunt.js for running node.js tasks (running
unit tests, counting code coverage, creating reports for
Sonar, checking the code semantics and complexity: jshint)
Afterdovcharitweekend2013
āœ¦ Weā€™ve refused from everything we had before but the
existing tests
āœ¦ Weā€™ve decided to switch to node.js for non-functional
requirements
āœ¦ Weā€™ve chosen grunt.js for running node.js tasks (running
unit tests, counting code coverage, creating reports for
Sonar, checking the code semantics and complexity: jshint)
āœ¦ Weā€™ve excluded any manual intervention: sided
applications for code coverage, exel creepy ļ¬les, etc.
Afterdovcharitweekend2013
āœ¦ Weā€™ve refused from everything we had before but the
existing tests
āœ¦ Weā€™ve decided to switch to node.js for non-functional
requirements
āœ¦ Weā€™ve chosen grunt.js for running node.js tasks (running
unit tests, counting code coverage, creating reports for
Sonar, checking the code semantics and complexity: jshint)
āœ¦ Weā€™ve excluded any manual intervention: sided
applications for code coverage, exel creepy ļ¬les, etc.
āœ¦ Weā€™ve put counting code health on Sonarā€™s shoulders for
back-end as well as UI
Afterdovcharitweekend2013
āœ¦ Weā€™ve refused from everything we had before but the
existing tests
āœ¦ Weā€™ve decided to switch to node.js for non-functional
requirements
āœ¦ Weā€™ve chosen grunt.js for running node.js tasks (running
unit tests, counting code coverage, creating reports for
Sonar, checking the code semantics and complexity: jshint)
āœ¦ Weā€™ve excluded any manual intervention: sided
applications for code coverage, exel creepy ļ¬les, etc.
āœ¦ Weā€™ve put counting code health on Sonarā€™s shoulders for
back-end as well as UI
āœ¦ Weā€™ve fastened unit testing on CI
Afterdovcharitweekend2013
āœ¦ Weā€™ve refused from everything we had before but the
existing tests
āœ¦ Weā€™ve decided to switch to node.js for non-functional
requirements
āœ¦ Weā€™ve chosen grunt.js for running node.js tasks (running
unit tests, counting code coverage, creating reports for
Sonar, checking the code semantics and complexity: jshint)
āœ¦ Weā€™ve excluded any manual intervention: sided
applications for code coverage, exel creepy ļ¬les, etc.
āœ¦ Weā€™ve put counting code health on Sonarā€™s shoulders for
back-end as well as UI
āœ¦ Weā€™ve fastened unit testing on CI
āœ¦ Weā€™ve prevented the developers from failed builds and
have given them the clear system for code quality analysis
and correction
Exampledovcharitweekend2013
Developmentprocessdovcharitweekend2013
Conclusiondovcharitweekend2013
Conclusiondovcharitweekend2013
Conclusiondovcharitweekend2013
+
Conclusiondovcharitweekend2013
+
Conclusiondovcharitweekend2013
+ +
Conclusiondovcharitweekend2013
+ +
Conclusiondovcharitweekend2013
=
+ +
Conclusiondovcharitweekend2013
=
+ +
Nodejsframeworksdovcharitweekend2013
Nodejsframeworksdovcharitweekend2013
Nodejsframeworksdovcharitweekend2013
Nodejsframeworksdovcharitweekend2013
Nodejsframeworksdovcharitweekend2013
Nodejsframeworksdovcharitweekend2013
Nodejsframeworksdovcharitweekend2013
Nodejsframeworksdovcharitweekend2013
Sailsdovcharitweekend2013
What is Sails.js?
Sailsdovcharitweekend2013
Sails.js make it easy to build custom, enterprise-grade Node.js
apps. It is designed to mimic the MVC pattern of frameworks
like Ruby on Rails, but with support for the requirements of
modern apps: data-driven APIs with scalable, service-oriented
architecture. It's especially good for building chat, realtime
dashboards, or multiplayer games.
What is Sails.js?
Featuresdovcharitweekend2013
Featuresdovcharitweekend2013
āœ¦ Sails.js is database agnostic. Its ORM, Waterline, provides a
simple data access layer that works, no matter what database
you're using.
Featuresdovcharitweekend2013
āœ¦ Sails.js is database agnostic. Its ORM, Waterline, provides a
simple data access layer that works, no matter what database
you're using.
āœ¦ Sails.js automatically generates a RESTful JSON API for your
app. That means you don't have to write any backend code to
build simple database apps.
Featuresdovcharitweekend2013
āœ¦ Sails.js is database agnostic. Its ORM, Waterline, provides a
simple data access layer that works, no matter what database
you're using.
āœ¦ Sails.js automatically generates a RESTful JSON API for your
app. That means you don't have to write any backend code to
build simple database apps.
āœ¦ Realtime Socket.io requests are routed to your controllers the
same way as everything else: with resourceful conventions and
URL mappings.
Featuresdovcharitweekend2013
āœ¦ Sails.js is database agnostic. Its ORM, Waterline, provides a
simple data access layer that works, no matter what database
you're using.
āœ¦ Sails.js automatically generates a RESTful JSON API for your
app. That means you don't have to write any backend code to
build simple database apps.
āœ¦ Realtime Socket.io requests are routed to your controllers the
same way as everything else: with resourceful conventions and
URL mappings.
āœ¦ Sails.js provides basic security and role-based access control
by default, and you can add as many custom policies as you like.
Featuresdovcharitweekend2013
āœ¦ Sails.js is database agnostic. Its ORM, Waterline, provides a
simple data access layer that works, no matter what database
you're using.
āœ¦ Sails.js automatically generates a RESTful JSON API for your
app. That means you don't have to write any backend code to
build simple database apps.
āœ¦ Realtime Socket.io requests are routed to your controllers the
same way as everything else: with resourceful conventions and
URL mappings.
āœ¦ Sails.js provides basic security and role-based access control
by default, and you can add as many custom policies as you like.
āœ¦ Because Express and Socket.io share the same configurable
session store, all of your security policies are reused for realtime
WebSocket requests as well.
Featuresdovcharitweekend2013
āœ¦ Sails.js is database agnostic. Its ORM, Waterline, provides a
simple data access layer that works, no matter what database
you're using.
āœ¦ Sails.js automatically generates a RESTful JSON API for your
app. That means you don't have to write any backend code to
build simple database apps.
āœ¦ Realtime Socket.io requests are routed to your controllers the
same way as everything else: with resourceful conventions and
URL mappings.
āœ¦ Sails.js provides basic security and role-based access control
by default, and you can add as many custom policies as you like.
āœ¦ Because Express and Socket.io share the same configurable
session store, all of your security policies are reused for realtime
WebSocket requests as well.
āœ¦ Sails.js has automatic asset minification. With Sails, you just
put your files in the proper folder and they are automatically
included in your layout. Then, when you're ready to go into
production, they are minified and gzipped to preserve as much
bandwidth as possible.
GetStarteddovcharitweekend2013
GetStarteddovcharitweekend2013
npm install -g sails
GetStarteddovcharitweekend2013
npm install -g sails
GetStarteddovcharitweekend2013
npm install -g sails
GetStarteddovcharitweekend2013
npm install -g sails
GetStarteddovcharitweekend2013
npm install -g sails
GetStarteddovcharitweekend2013
npm install -g sails
GetStarteddovcharitweekend2013
npm install -g sails
GetStarteddovcharitweekend2013
npm install -g sails
GetStarteddovcharitweekend2013
npm install -g sails
GetStarteddovcharitweekend2013
npm install -g sails
Controllerdovcharitweekend2013
Controllerdovcharitweekend2013
Controllerdovcharitweekend2013
Controllerdovcharitweekend2013
Controllerdovcharitweekend2013
Controllerdovcharitweekend2013
āœ¦ req.param()
Controllerdovcharitweekend2013
āœ¦ req.param()
āœ¦ req.isSocket
Controllerdovcharitweekend2013
āœ¦ req.param()
āœ¦ req.isSocket
āœ¦ req.isAjax
Controllerdovcharitweekend2013
āœ¦ req.param()
āœ¦ req.isSocket
āœ¦ req.isAjax
āœ¦ req.isJson
Controllerdovcharitweekend2013
āœ¦ req.param()
āœ¦ req.isSocket
āœ¦ req.isAjax
āœ¦ req.isJson
āœ¦ res.view()
Controllerdovcharitweekend2013
āœ¦ req.param()
āœ¦ req.isSocket
āœ¦ req.isAjax
āœ¦ req.isJson
āœ¦ res.view()
āœ¦ res.send()
Controllerdovcharitweekend2013
āœ¦ req.param()
āœ¦ req.isSocket
āœ¦ req.isAjax
āœ¦ req.isJson
āœ¦ res.view()
āœ¦ res.send()
āœ¦ res.json()
Controllerdovcharitweekend2013
āœ¦ req.param()
āœ¦ req.isSocket
āœ¦ req.isAjax
āœ¦ req.isJson
āœ¦ res.view()
āœ¦ res.send()
āœ¦ res.json()
āœ¦ res.redirect()
Controllerdovcharitweekend2013
āœ¦ req.param()
āœ¦ req.isSocket
āœ¦ req.isAjax
āœ¦ req.isJson
āœ¦ res.view()
āœ¦ res.send()
āœ¦ res.json()
āœ¦ res.redirect()
āœ¦ res.viewExists
Modeldovcharitweekend2013
Modeldovcharitweekend2013
Modeldovcharitweekend2013
Modeldovcharitweekend2013
Modeldovcharitweekend2013
āœ¦ Attributes
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
āœ¦ Instance Methods (save, destroy,
toObject, toJSON)
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
āœ¦ Instance Methods (save, destroy,
toObject, toJSON)
āœ¦ Custom Deļ¬ned Instance Methods
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
āœ¦ Instance Methods (save, destroy,
toObject, toJSON)
āœ¦ Custom Deļ¬ned Instance Methods
āœ¦ Lifecycle callbacks
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
āœ¦ Instance Methods (save, destroy,
toObject, toJSON)
āœ¦ Custom Deļ¬ned Instance Methods
āœ¦ Lifecycle callbacks
āœ¦ Custom tables name
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
āœ¦ Instance Methods (save, destroy,
toObject, toJSON)
āœ¦ Custom Deļ¬ned Instance Methods
āœ¦ Lifecycle callbacks
āœ¦ Custom tables name
āœ¦ Adapters
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
āœ¦ Instance Methods (save, destroy,
toObject, toJSON)
āœ¦ Custom Deļ¬ned Instance Methods
āœ¦ Lifecycle callbacks
āœ¦ Custom tables name
āœ¦ Adapters
āœ¦ Associations
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
āœ¦ Instance Methods (save, destroy,
toObject, toJSON)
āœ¦ Custom Deļ¬ned Instance Methods
āœ¦ Lifecycle callbacks
āœ¦ Custom tables name
āœ¦ Adapters
āœ¦ Associations
āœ¦ Automatic schema creation
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
āœ¦ Instance Methods (save, destroy,
toObject, toJSON)
āœ¦ Custom Deļ¬ned Instance Methods
āœ¦ Lifecycle callbacks
āœ¦ Custom tables name
āœ¦ Adapters
āœ¦ Associations
āœ¦ Automatic schema creation
āœ¦ Data manipulation: create, ļ¬ndOne,
ļ¬nd, dynamic ļ¬nders (i.e ļ¬ndByName),
update, destroy,
Modeldovcharitweekend2013
āœ¦ Attributes
āœ¦ Validations
āœ¦ Instance Methods (save, destroy,
toObject, toJSON)
āœ¦ Custom Deļ¬ned Instance Methods
āœ¦ Lifecycle callbacks
āœ¦ Custom tables name
āœ¦ Adapters
āœ¦ Associations
āœ¦ Automatic schema creation
āœ¦ Data manipulation: create, ļ¬ndOne,
ļ¬nd, dynamic ļ¬nders (i.e ļ¬ndByName),
update, destroy,
āœ¦ Migrations
dovcharitweekend2013
View/Assets
Routersdovcharitweekend2013
Routersdovcharitweekend2013
āœ¦ If the URL is not speciļ¬ed in conļ¬g/routes.js, the default route for a
URL is: /:controller/:action/:id where :controller, :action, and the :id
request parameter are derived from the url.
āœ¦ If the requested controller/action doesn't exist: - if a view exists ( /
views/:controller/:action.ejs), Sails will render that view - if no view
exists, but a model exists, Sails will automatically generate a JSON API
for the model which matches :controller. - if no view OR model exists,
Sails will respond with a 404.
Routersdovcharitweekend2013
āœ¦ If the URL is not speciļ¬ed in conļ¬g/routes.js, the default route for a
URL is: /:controller/:action/:id where :controller, :action, and the :id
request parameter are derived from the url.
āœ¦ If the requested controller/action doesn't exist: - if a view exists ( /
views/:controller/:action.ejs), Sails will render that view - if no view
exists, but a model exists, Sails will automatically generate a JSON API
for the model which matches :controller. - if no view OR model exists,
Sails will respond with a 404.
Underthehuddovcharitweekend2013
Underthehuddovcharitweekend2013
āœ¦ Policies
āœ¦ Custom adapters
āœ¦ Deployment
āœ¦ Conļ¬gurations
āœ¦ Database support
āœ¦ Sockets
Conclusiondovcharitweekend2013
Linksdovcharitweekend2013
Linksdovcharitweekend2013
āœ¦ Node.js
Linksdovcharitweekend2013
āœ¦ Node.js
āœ¦ Sonarqube
Linksdovcharitweekend2013
āœ¦ Node.js
āœ¦ Sonarqube
āœ¦ grunt, bower, yeoman
Linksdovcharitweekend2013
āœ¦ Node.js
āœ¦ Sonarqube
āœ¦ grunt, bower, yeoman
āœ¦ pacemaker, scriptā€™nā€™code
Linksdovcharitweekend2013
āœ¦ Node.js
āœ¦ Sonarqube
āœ¦ grunt, bower, yeoman
āœ¦ pacemaker, scriptā€™nā€™code
āœ¦ Sails.js
Facebook Twitter Linkedin Gmail
Questionsdovcharitweekend2013
Questions?
dovcharitweekend2013

Mais conteĆŗdo relacionado

Mais procurados

Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
Spike Brehm
Ā 
System webpack-jspm
System webpack-jspmSystem webpack-jspm
System webpack-jspm
Jesse Warden
Ā 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
Bob Paulin
Ā 
Š”ŠµŠŗрŠµŃ‚Š½Ń‹Š¹ Š“Š¾ŠŗŠ»Š°Š“ Š¾ React Router - OdessaJS 2014
Š”ŠµŠŗрŠµŃ‚Š½Ń‹Š¹ Š“Š¾ŠŗŠ»Š°Š“ Š¾ React Router - OdessaJS 2014Š”ŠµŠŗрŠµŃ‚Š½Ń‹Š¹ Š“Š¾ŠŗŠ»Š°Š“ Š¾ React Router - OdessaJS 2014
Š”ŠµŠŗрŠµŃ‚Š½Ń‹Š¹ Š“Š¾ŠŗŠ»Š°Š“ Š¾ React Router - OdessaJS 2014
Andrey Listochkin
Ā 

Mais procurados (20)

Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
Ā 
Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
Ā 
REST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side DevelopmentREST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side Development
Ā 
Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)
Ā 
System webpack-jspm
System webpack-jspmSystem webpack-jspm
System webpack-jspm
Ā 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
Ā 
Nuxt.js - Introduction
Nuxt.js - IntroductionNuxt.js - Introduction
Nuxt.js - Introduction
Ā 
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
Ā 
Nuxt Talk
Nuxt TalkNuxt Talk
Nuxt Talk
Ā 
Build RESTful API Using Express JS
Build RESTful API Using Express JSBuild RESTful API Using Express JS
Build RESTful API Using Express JS
Ā 
Packing for the Web with Webpack
Packing for the Web with WebpackPacking for the Web with Webpack
Packing for the Web with Webpack
Ā 
Webpack
Webpack Webpack
Webpack
Ā 
Server Side Apocalypse, JS
Server Side Apocalypse, JSServer Side Apocalypse, JS
Server Side Apocalypse, JS
Ā 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 version
Ā 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
Ā 
Š”ŠµŠŗрŠµŃ‚Š½Ń‹Š¹ Š“Š¾ŠŗŠ»Š°Š“ Š¾ React Router - OdessaJS 2014
Š”ŠµŠŗрŠµŃ‚Š½Ń‹Š¹ Š“Š¾ŠŗŠ»Š°Š“ Š¾ React Router - OdessaJS 2014Š”ŠµŠŗрŠµŃ‚Š½Ń‹Š¹ Š“Š¾ŠŗŠ»Š°Š“ Š¾ React Router - OdessaJS 2014
Š”ŠµŠŗрŠµŃ‚Š½Ń‹Š¹ Š“Š¾ŠŗŠ»Š°Š“ Š¾ React Router - OdessaJS 2014
Ā 
Nodejs web,db,hosting
Nodejs web,db,hostingNodejs web,db,hosting
Nodejs web,db,hosting
Ā 
DEV208 - ASP.NET MVC 5 ę–°åŠŸčƒ½ęŽ¢ē“¢
DEV208 - ASP.NET MVC 5 ę–°åŠŸčƒ½ęŽ¢ē“¢DEV208 - ASP.NET MVC 5 ę–°åŠŸčƒ½ęŽ¢ē“¢
DEV208 - ASP.NET MVC 5 ę–°åŠŸčƒ½ęŽ¢ē“¢
Ā 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
Ā 
Running Node.js in Production using Passenger
Running Node.js in Production using PassengerRunning Node.js in Production using Passenger
Running Node.js in Production using Passenger
Ā 

Semelhante a NodeWay in my project & sails.js

Semelhante a NodeWay in my project & sails.js (20)

How to Enterprise Node
How to Enterprise NodeHow to Enterprise Node
How to Enterprise Node
Ā 
Go Revel Gooo...
Go Revel Gooo...Go Revel Gooo...
Go Revel Gooo...
Ā 
Hybrid Application Development
Hybrid Application DevelopmentHybrid Application Development
Hybrid Application Development
Ā 
Ionic best practices
Ionic best practicesIonic best practices
Ionic best practices
Ā 
Ionic best practices
Ionic best practicesIonic best practices
Ionic best practices
Ā 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
Ā 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
Ā 
Lecture02web 140phpapp01
Lecture02web 140phpapp01Lecture02web 140phpapp01
Lecture02web 140phpapp01
Ā 
Cross-platform Desktop application with AngularJS and build with Node-webkit
Cross-platform Desktop application with AngularJS and build with Node-webkitCross-platform Desktop application with AngularJS and build with Node-webkit
Cross-platform Desktop application with AngularJS and build with Node-webkit
Ā 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Ā 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Ā 
Node, express & sails
Node, express & sailsNode, express & sails
Node, express & sails
Ā 
Web Development: Making it the right way
Web Development: Making it the right wayWeb Development: Making it the right way
Web Development: Making it the right way
Ā 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
Ā 
Nodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to heroNodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to hero
Ā 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
Ā 
Pender presentation 2.0
Pender presentation 2.0 Pender presentation 2.0
Pender presentation 2.0
Ā 
Metasepi team meeting #8': Haskell apps on Android NDK
Metasepi team meeting #8': Haskell apps on Android NDKMetasepi team meeting #8': Haskell apps on Android NDK
Metasepi team meeting #8': Haskell apps on Android NDK
Ā 
Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!
Ā 
WordPress automation and CI
WordPress automation and CIWordPress automation and CI
WordPress automation and CI
Ā 

ƚltimo

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(ā˜Žļø+971_581248768%)**%*]'#abortion pills for sale in dubai@
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Ā 

ƚltimo (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Ā 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
Ā 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Ā 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
Ā 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
Ā 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Ā 
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Ā 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Ā 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Ā 

NodeWay in my project & sails.js