SlideShare uma empresa Scribd logo
1 de 64
Rapid API Development with Sails
10/11/2017, 1:15-1:35pm
Justin James
DevOps Evangelist and Microsoft MVP
@digitaldrummerj
© AngularMIX All rights reserved.
https://www.angularmix.com
Deliver Value to Users
as Quickly as Possible!
© AngularMIX All rights reserved.
https://www.angularmix.com
Not Paid to Write
Infrastructure Code!
© AngularMIX All rights reserved.
https://www.angularmix.com
Create JavaScript Services
© AngularMIX All rights reserved.
https://www.angularmix.com
Auto-generated REST APIs
© AngularMIX All rights reserved.
https://www.angularmix.com
Any Database
© AngularMIX All rights reserved.
https://www.angularmix.com
Flexible and Configurable
© AngularMIX All rights reserved.
https://www.angularmix.com
Security Policies
© AngularMIX All rights reserved.
https://www.angularmix.com
Built-On Top of
© AngularMIX All rights reserved.
https://www.angularmix.com
Ridiculously Fast
© AngularMIX All rights reserved.
https://www.angularmix.com
Just Works
© AngularMIX All rights reserved.
https://www.angularmix.com
Does NOT hide the magic
© AngularMIX All rights reserved.
https://www.angularmix.com
© AngularMIX All rights reserved.
https://www.angularmix.com
Ultimately,
writing tiny amounts of code
gets you a ton!
© AngularMIX All rights reserved.
https://www.angularmix.com
Getting Started
© AngularMIX All rights reserved.
https://www.angularmix.com
Install
© AngularMIX All rights reserved.
https://www.angularmix.com
Install Sails
npm install –g sails
© AngularMIX All rights reserved.
https://www.angularmix.com
Create Project
sails new [Project Name] --no-linker --no-frontend
© AngularMIX All rights reserved.
https://www.angularmix.com
Generate API
sails generate api [Api Name]
© AngularMIX All rights reserved.
https://www.angularmix.com
Start Sails Dev Server
sails lift
© AngularMIX All rights reserved.
https://www.angularmix.com
Start Sails in Production
node app.js
© AngularMIX All rights reserved.
https://www.angularmix.com
Debug Sails Way #1
node --inspect app.js
© AngularMIX All rights reserved.
https://www.angularmix.com
Debug Sails Way #2
Use Visual Studio Code Built-In Debugger
© AngularMIX All rights reserved.
https://www.angularmix.com
function timeForSomeCode () {
……
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Controller - apicontrollers<Api Name>Controller.js
module.exports = {
};
© AngularMIX All rights reserved.
https://www.angularmix.com
Model - apimodels<Api Name>.js
module.exports = {
attributes: {
}
};
© AngularMIX All rights reserved.
https://www.angularmix.com
Using Api
 POST http://localhost:1337/<Api Name>
 GET http://localhost:1337/<Api Name>
 PUT http://localhost:1337/<Api Name>/:id
 DELETE http://localhost:1337/<Api Name>/:id
© AngularMIX All rights reserved.
https://www.angularmix.com
POST – http://localhost:1337/user
{
"email": "foo2@foo.com",
"lastName": "James",
"firstName": "Justin",
}
© AngularMIX All rights reserved.
https://www.angularmix.com
POST Response - http://localhost:1337/user
{
"email": "foo2@foo.com",
"lastName": "James",
"firstName": "Justin",
"createdAt": "2017-10-11T20:15:24.151Z",
"updatedAt": "2017-10-11T20:15:24.151Z",
"id": 1
}
© AngularMIX All rights reserved.
https://www.angularmix.com
GET Response – http://localhost:1337/user
[{
"email": "foo2@foo.com",
"lastName": "James",
"firstName": "Justin",
"createdAt": "2017-10-11T20:15:24.151Z",
"updatedAt": "2017-10-11T20:15:24.151Z",
"id": 1
}]
© AngularMIX All rights reserved.
https://www.angularmix.com
Build Out Model – apimodelsUser.js
module.exports = {
attributes: {
email: { required: true, unique: true, type: 'string' },
lastName: { required: true, type: 'string' },
firstName: { required: true, type: 'string' },
todoItems: {
collection: 'todo',
via: 'user',
},
},
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Build Out Model – apimodelsUser.js
module.exports = {
attributes: {
email: {required: true, unique: true, type: 'string' },
lastName: { required: true, type: 'string' },
firstName: { required: true, type: 'string' },
todoItems: {
collection: 'todo',
via: 'user',
},
},
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Build Out Model – apimodelsUser.js
module.exports = {
attributes: {
email: {required: true, unique: true, type: 'string' },
lastName: { required: true, type: 'string' },
firstName: { required: true, type: 'string' },
todoItems: {
collection: 'todo',
via: 'user',
},
},
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Build Out Model – apimodelsUser.js
module.exports = {
attributes: {
email: {required: true, unique: true, type: 'string' },
lastName: { required: true, type: 'string' },
firstName: { required: true, type: 'string' },
todoItems: {
collection: 'todo',
via: 'user',
},
},
}
© AngularMIX All rights reserved.
https://www.angularmix.com
One to Many – apimodelsTodo.js
module.exports = {
attributes: {
.....
user: {
model: 'User',
}
}
};
© AngularMIX All rights reserved.
https://www.angularmix.com
Override Built-In REST verbs
module.exports = {
find: function findFn(req, res) {}, // GET
findOne: function findOneFn(req, res) {}, // GET/id
create: function createFn(req, res) {}, // POST
update: function updateFn(req, res) {}, // PUT
delete: function deleteFn(req, res) {}, // DELETE
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Get User – http://localhost:1337/user/:id
findOne: function findOneFn(req, res) {
User.findOne({ id: req.param('id') })
.populate('todoItems')
.exec(function (err, user) {
if (err) return res.serverError(err);
if (!user) return res.notFound();
return res.ok(user);
});
},
© AngularMIX All rights reserved.
https://www.angularmix.com
Get User – http://localhost:1337/user/:id
findOne: function findOneFn(req, res) {
User.findOne({ id: req.param('id') })
.populate('todoItems')
.exec(function (err, user) {
if (err) return res.serverError(err);
if (!user) return res.notFound();
return res.ok(user);
});
},
© AngularMIX All rights reserved.
https://www.angularmix.com
Get User – http://localhost:1337/user/:id
findOne: function findOneFn(req, res) {
User.findOne({ id: req.param('id') })
.populate('todoItems')
.exec(function (err, user) {
if (err) return res.serverError(err);
if (!user) return res.notFound();
return res.ok(user);
});
},
© AngularMIX All rights reserved.
https://www.angularmix.com
Get User – http://localhost:1337/user/:id
findOne: function findOneFn(req, res) {
User.findOne({ id: req.param('id') })
.populate('todoItems')
.exec(function (err, user) {
if (err) return res.serverError(err);
if (!user) return res.notFound();
return res.ok(user);
});
},
© AngularMIX All rights reserved.
https://www.angularmix.com
Get User – http://localhost:1337/user/:id
findOne: function findOneFn(req, res) {
User.findOne({ id: req.param('id') })
.populate('todoItems')
.exec(function (err, user) {
if (err) return res.serverError(err);
if (!user) return res.notFound();
return res.ok(user);
});
},
© AngularMIX All rights reserved.
https://www.angularmix.com
Get User – http://localhost:1337/user/:id
findOne: function findOneFn(req, res) {
User.findOne({ id: req.param('id') })
.populate('todoItems')
.exec(function (err, user) {
if (err) return res.serverError(err);
if (!user) return res.notFound();
return res.ok(user);
});
},
© AngularMIX All rights reserved.
https://www.angularmix.com
Get User – http://localhost:1337/user/:id
findOne: function findOneFn(req, res) {
User.findOne({ id: req.param('id') })
.populate('todoItems')
.exec(function (err, user) {
if (err) return res.serverError(err);
if (!user) return res.notFound();
return res.ok(user);
});
},
© AngularMIX All rights reserved.
https://www.angularmix.com
Get User – http://localhost:1337/user/:id
findOne: function findOneFn(req, res) {
User.findOne({ id: req.param('id') })
.populate('todoItems')
.exec(function (err, user) {
if (err) return res.serverError(err);
if (!user) return res.notFound();
return res.ok(user);
});
},
© AngularMIX All rights reserved.
https://www.angularmix.com
Get User Response – http://localhost:1337/user/:id
{
"todoItems": [],
"email": "foo2@foo.com",
"lastName": "James",
"firstName": "Justin",
"createdAt": "2017-10-10T15:39:06.838Z",
"updatedAt": "2017-10-10T15:39:06.838Z",
"id": 1
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Security – apipoliciesisLoggedIn.js
module.exports = function(req, res, next) {
if (req.session.user) return next();
return res.forbidden('Please Login First.');
};
© AngularMIX All rights reserved.
https://www.angularmix.com
Security – apipoliciesisLoggedIn.js
module.exports = function(req, res, next) {
if (req.session.user) return next();
return res.forbidden('Please Login First.');
};
© AngularMIX All rights reserved.
https://www.angularmix.com
Security – apipoliciesisLoggedIn.js
module.exports = function(req, res, next) {
if (req.session.user) return next();
return res.forbidden('Please Login First.');
};
© AngularMIX All rights reserved.
https://www.angularmix.com
Security – apipoliciesisLoggedIn.js
module.exports = function(req, res, next) {
if (req.session.user) return next();
return res.forbidden('Please Login First.');
};
© AngularMIX All rights reserved.
https://www.angularmix.com
Implement Policy– configpolicies.js
module.exports.policies = {
UserController: {
create: ['isLoggedOut'],
login: ['isLoggedOut'],
'*': ['isLoggedIn'],
},
TodoController: {
'*': ['isLoggedIn']
}
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Implement Policy– configpolicies.js
module.exports.policies = {
UserController: {
create: ['isLoggedOut'],
login: ['isLoggedOut'],
'*': ['isLoggedIn'],
},
TodoController: {
'*': ['isLoggedIn']
}
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Implement Policy– configpolicies.js
module.exports.policies = {
UserController: {
create: ['isLoggedOut'],
login: ['isLoggedOut'],
'*': ['isLoggedIn'],
},
TodoController: {
'*': ['isLoggedIn']
}
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Implement Policy– configpolicies.js
module.exports.policies = {
UserController: {
create: ['isLoggedOut'],
login: ['isLoggedOut'],
'*': ['isLoggedIn'],
},
TodoController: {
'*': ['isLoggedIn']
}
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Implement Policy– configpolicies.js
module.exports.policies = {
UserController: {
create: ['isLoggedOut'],
login: ['isLoggedOut'],
'*': ['isLoggedIn'],
},
TodoController: {
'*': ['isLoggedIn']
}
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Implement Policy– configpolicies.js
module.exports.policies = {
UserController: {
create: ['isLoggedOut'],
login: ['isLoggedOut'],
'*': ['isLoggedIn'],
},
TodoController: {
'*': ['isLoggedIn']
}
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Implement Policy– configpolicies.js
module.exports.policies = {
UserController: {
create: ['isLoggedOut'],
login: ['isLoggedOut'],
'*': ['isLoggedIn'],
},
TodoController: {
'*': ['isLoggedIn']
}
}
© AngularMIX All rights reserved.
https://www.angularmix.com
Custom Function – apiControllersUserController.js
userIdentity: function (req, res) {
....
},
© AngularMIX All rights reserved.
https://www.angularmix.com
Custom Function – apiControllersUserController.js
userIdentity: function (req, res) {
....
},
URL: http://localhost:1337/user/userIdentity
© AngularMIX All rights reserved.
https://www.angularmix.com
Routes – config/routes.js
module.exports.routes = {
'GET /user/identity': 'UserController.userIdentity',
};
© AngularMIX All rights reserved.
https://www.angularmix.com
References
 Documentation:
 http://sailsjs.com/
 Slides:
 https://slideshare.net/digitaldrummerj
 Demo Code:
 https://github.com/digitaldrummerj/angular-mix
 Tutorial:
 http://digitaldrummerj.me/sails-tutorial
© AngularMIX All rights reserved.
https://www.angularmix.com
digitaldrummerj.me
digitaldrummerj
© AngularMIX All rights reserved.
https://www.angularmix.com
Please use EventsXD to fill out a session evaluation.
Thank you!
© AngularMIX All rights reserved.
https://www.angularmix.com
Please use EventsXD to fill out a session evaluation.
Thank you!
© AngularMIX All rights reserved.
https://www.angularmix.com
Sails
Solves These

Mais conteúdo relacionado

Último

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 

Último (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Rapid Api Development With Sails at Angular Mix

  • 1. Rapid API Development with Sails 10/11/2017, 1:15-1:35pm Justin James DevOps Evangelist and Microsoft MVP @digitaldrummerj
  • 2. © AngularMIX All rights reserved. https://www.angularmix.com Deliver Value to Users as Quickly as Possible!
  • 3. © AngularMIX All rights reserved. https://www.angularmix.com Not Paid to Write Infrastructure Code!
  • 4. © AngularMIX All rights reserved. https://www.angularmix.com Create JavaScript Services
  • 5. © AngularMIX All rights reserved. https://www.angularmix.com Auto-generated REST APIs
  • 6. © AngularMIX All rights reserved. https://www.angularmix.com Any Database
  • 7. © AngularMIX All rights reserved. https://www.angularmix.com Flexible and Configurable
  • 8. © AngularMIX All rights reserved. https://www.angularmix.com Security Policies
  • 9. © AngularMIX All rights reserved. https://www.angularmix.com Built-On Top of
  • 10. © AngularMIX All rights reserved. https://www.angularmix.com Ridiculously Fast
  • 11. © AngularMIX All rights reserved. https://www.angularmix.com Just Works
  • 12. © AngularMIX All rights reserved. https://www.angularmix.com Does NOT hide the magic
  • 13. © AngularMIX All rights reserved. https://www.angularmix.com
  • 14. © AngularMIX All rights reserved. https://www.angularmix.com Ultimately, writing tiny amounts of code gets you a ton!
  • 15. © AngularMIX All rights reserved. https://www.angularmix.com Getting Started
  • 16. © AngularMIX All rights reserved. https://www.angularmix.com Install
  • 17. © AngularMIX All rights reserved. https://www.angularmix.com Install Sails npm install –g sails
  • 18. © AngularMIX All rights reserved. https://www.angularmix.com Create Project sails new [Project Name] --no-linker --no-frontend
  • 19. © AngularMIX All rights reserved. https://www.angularmix.com Generate API sails generate api [Api Name]
  • 20. © AngularMIX All rights reserved. https://www.angularmix.com Start Sails Dev Server sails lift
  • 21. © AngularMIX All rights reserved. https://www.angularmix.com Start Sails in Production node app.js
  • 22. © AngularMIX All rights reserved. https://www.angularmix.com Debug Sails Way #1 node --inspect app.js
  • 23. © AngularMIX All rights reserved. https://www.angularmix.com Debug Sails Way #2 Use Visual Studio Code Built-In Debugger
  • 24. © AngularMIX All rights reserved. https://www.angularmix.com function timeForSomeCode () { …… }
  • 25. © AngularMIX All rights reserved. https://www.angularmix.com Controller - apicontrollers<Api Name>Controller.js module.exports = { };
  • 26. © AngularMIX All rights reserved. https://www.angularmix.com Model - apimodels<Api Name>.js module.exports = { attributes: { } };
  • 27. © AngularMIX All rights reserved. https://www.angularmix.com Using Api  POST http://localhost:1337/<Api Name>  GET http://localhost:1337/<Api Name>  PUT http://localhost:1337/<Api Name>/:id  DELETE http://localhost:1337/<Api Name>/:id
  • 28. © AngularMIX All rights reserved. https://www.angularmix.com POST – http://localhost:1337/user { "email": "foo2@foo.com", "lastName": "James", "firstName": "Justin", }
  • 29. © AngularMIX All rights reserved. https://www.angularmix.com POST Response - http://localhost:1337/user { "email": "foo2@foo.com", "lastName": "James", "firstName": "Justin", "createdAt": "2017-10-11T20:15:24.151Z", "updatedAt": "2017-10-11T20:15:24.151Z", "id": 1 }
  • 30. © AngularMIX All rights reserved. https://www.angularmix.com GET Response – http://localhost:1337/user [{ "email": "foo2@foo.com", "lastName": "James", "firstName": "Justin", "createdAt": "2017-10-11T20:15:24.151Z", "updatedAt": "2017-10-11T20:15:24.151Z", "id": 1 }]
  • 31. © AngularMIX All rights reserved. https://www.angularmix.com Build Out Model – apimodelsUser.js module.exports = { attributes: { email: { required: true, unique: true, type: 'string' }, lastName: { required: true, type: 'string' }, firstName: { required: true, type: 'string' }, todoItems: { collection: 'todo', via: 'user', }, }, }
  • 32. © AngularMIX All rights reserved. https://www.angularmix.com Build Out Model – apimodelsUser.js module.exports = { attributes: { email: {required: true, unique: true, type: 'string' }, lastName: { required: true, type: 'string' }, firstName: { required: true, type: 'string' }, todoItems: { collection: 'todo', via: 'user', }, }, }
  • 33. © AngularMIX All rights reserved. https://www.angularmix.com Build Out Model – apimodelsUser.js module.exports = { attributes: { email: {required: true, unique: true, type: 'string' }, lastName: { required: true, type: 'string' }, firstName: { required: true, type: 'string' }, todoItems: { collection: 'todo', via: 'user', }, }, }
  • 34. © AngularMIX All rights reserved. https://www.angularmix.com Build Out Model – apimodelsUser.js module.exports = { attributes: { email: {required: true, unique: true, type: 'string' }, lastName: { required: true, type: 'string' }, firstName: { required: true, type: 'string' }, todoItems: { collection: 'todo', via: 'user', }, }, }
  • 35. © AngularMIX All rights reserved. https://www.angularmix.com One to Many – apimodelsTodo.js module.exports = { attributes: { ..... user: { model: 'User', } } };
  • 36. © AngularMIX All rights reserved. https://www.angularmix.com Override Built-In REST verbs module.exports = { find: function findFn(req, res) {}, // GET findOne: function findOneFn(req, res) {}, // GET/id create: function createFn(req, res) {}, // POST update: function updateFn(req, res) {}, // PUT delete: function deleteFn(req, res) {}, // DELETE }
  • 37. © AngularMIX All rights reserved. https://www.angularmix.com Get User – http://localhost:1337/user/:id findOne: function findOneFn(req, res) { User.findOne({ id: req.param('id') }) .populate('todoItems') .exec(function (err, user) { if (err) return res.serverError(err); if (!user) return res.notFound(); return res.ok(user); }); },
  • 38. © AngularMIX All rights reserved. https://www.angularmix.com Get User – http://localhost:1337/user/:id findOne: function findOneFn(req, res) { User.findOne({ id: req.param('id') }) .populate('todoItems') .exec(function (err, user) { if (err) return res.serverError(err); if (!user) return res.notFound(); return res.ok(user); }); },
  • 39. © AngularMIX All rights reserved. https://www.angularmix.com Get User – http://localhost:1337/user/:id findOne: function findOneFn(req, res) { User.findOne({ id: req.param('id') }) .populate('todoItems') .exec(function (err, user) { if (err) return res.serverError(err); if (!user) return res.notFound(); return res.ok(user); }); },
  • 40. © AngularMIX All rights reserved. https://www.angularmix.com Get User – http://localhost:1337/user/:id findOne: function findOneFn(req, res) { User.findOne({ id: req.param('id') }) .populate('todoItems') .exec(function (err, user) { if (err) return res.serverError(err); if (!user) return res.notFound(); return res.ok(user); }); },
  • 41. © AngularMIX All rights reserved. https://www.angularmix.com Get User – http://localhost:1337/user/:id findOne: function findOneFn(req, res) { User.findOne({ id: req.param('id') }) .populate('todoItems') .exec(function (err, user) { if (err) return res.serverError(err); if (!user) return res.notFound(); return res.ok(user); }); },
  • 42. © AngularMIX All rights reserved. https://www.angularmix.com Get User – http://localhost:1337/user/:id findOne: function findOneFn(req, res) { User.findOne({ id: req.param('id') }) .populate('todoItems') .exec(function (err, user) { if (err) return res.serverError(err); if (!user) return res.notFound(); return res.ok(user); }); },
  • 43. © AngularMIX All rights reserved. https://www.angularmix.com Get User – http://localhost:1337/user/:id findOne: function findOneFn(req, res) { User.findOne({ id: req.param('id') }) .populate('todoItems') .exec(function (err, user) { if (err) return res.serverError(err); if (!user) return res.notFound(); return res.ok(user); }); },
  • 44. © AngularMIX All rights reserved. https://www.angularmix.com Get User – http://localhost:1337/user/:id findOne: function findOneFn(req, res) { User.findOne({ id: req.param('id') }) .populate('todoItems') .exec(function (err, user) { if (err) return res.serverError(err); if (!user) return res.notFound(); return res.ok(user); }); },
  • 45. © AngularMIX All rights reserved. https://www.angularmix.com Get User Response – http://localhost:1337/user/:id { "todoItems": [], "email": "foo2@foo.com", "lastName": "James", "firstName": "Justin", "createdAt": "2017-10-10T15:39:06.838Z", "updatedAt": "2017-10-10T15:39:06.838Z", "id": 1 }
  • 46. © AngularMIX All rights reserved. https://www.angularmix.com Security – apipoliciesisLoggedIn.js module.exports = function(req, res, next) { if (req.session.user) return next(); return res.forbidden('Please Login First.'); };
  • 47. © AngularMIX All rights reserved. https://www.angularmix.com Security – apipoliciesisLoggedIn.js module.exports = function(req, res, next) { if (req.session.user) return next(); return res.forbidden('Please Login First.'); };
  • 48. © AngularMIX All rights reserved. https://www.angularmix.com Security – apipoliciesisLoggedIn.js module.exports = function(req, res, next) { if (req.session.user) return next(); return res.forbidden('Please Login First.'); };
  • 49. © AngularMIX All rights reserved. https://www.angularmix.com Security – apipoliciesisLoggedIn.js module.exports = function(req, res, next) { if (req.session.user) return next(); return res.forbidden('Please Login First.'); };
  • 50. © AngularMIX All rights reserved. https://www.angularmix.com Implement Policy– configpolicies.js module.exports.policies = { UserController: { create: ['isLoggedOut'], login: ['isLoggedOut'], '*': ['isLoggedIn'], }, TodoController: { '*': ['isLoggedIn'] } }
  • 51. © AngularMIX All rights reserved. https://www.angularmix.com Implement Policy– configpolicies.js module.exports.policies = { UserController: { create: ['isLoggedOut'], login: ['isLoggedOut'], '*': ['isLoggedIn'], }, TodoController: { '*': ['isLoggedIn'] } }
  • 52. © AngularMIX All rights reserved. https://www.angularmix.com Implement Policy– configpolicies.js module.exports.policies = { UserController: { create: ['isLoggedOut'], login: ['isLoggedOut'], '*': ['isLoggedIn'], }, TodoController: { '*': ['isLoggedIn'] } }
  • 53. © AngularMIX All rights reserved. https://www.angularmix.com Implement Policy– configpolicies.js module.exports.policies = { UserController: { create: ['isLoggedOut'], login: ['isLoggedOut'], '*': ['isLoggedIn'], }, TodoController: { '*': ['isLoggedIn'] } }
  • 54. © AngularMIX All rights reserved. https://www.angularmix.com Implement Policy– configpolicies.js module.exports.policies = { UserController: { create: ['isLoggedOut'], login: ['isLoggedOut'], '*': ['isLoggedIn'], }, TodoController: { '*': ['isLoggedIn'] } }
  • 55. © AngularMIX All rights reserved. https://www.angularmix.com Implement Policy– configpolicies.js module.exports.policies = { UserController: { create: ['isLoggedOut'], login: ['isLoggedOut'], '*': ['isLoggedIn'], }, TodoController: { '*': ['isLoggedIn'] } }
  • 56. © AngularMIX All rights reserved. https://www.angularmix.com Implement Policy– configpolicies.js module.exports.policies = { UserController: { create: ['isLoggedOut'], login: ['isLoggedOut'], '*': ['isLoggedIn'], }, TodoController: { '*': ['isLoggedIn'] } }
  • 57. © AngularMIX All rights reserved. https://www.angularmix.com Custom Function – apiControllersUserController.js userIdentity: function (req, res) { .... },
  • 58. © AngularMIX All rights reserved. https://www.angularmix.com Custom Function – apiControllersUserController.js userIdentity: function (req, res) { .... }, URL: http://localhost:1337/user/userIdentity
  • 59. © AngularMIX All rights reserved. https://www.angularmix.com Routes – config/routes.js module.exports.routes = { 'GET /user/identity': 'UserController.userIdentity', };
  • 60. © AngularMIX All rights reserved. https://www.angularmix.com References  Documentation:  http://sailsjs.com/  Slides:  https://slideshare.net/digitaldrummerj  Demo Code:  https://github.com/digitaldrummerj/angular-mix  Tutorial:  http://digitaldrummerj.me/sails-tutorial
  • 61. © AngularMIX All rights reserved. https://www.angularmix.com digitaldrummerj.me digitaldrummerj
  • 62. © AngularMIX All rights reserved. https://www.angularmix.com Please use EventsXD to fill out a session evaluation. Thank you!
  • 63. © AngularMIX All rights reserved. https://www.angularmix.com Please use EventsXD to fill out a session evaluation. Thank you!
  • 64. © AngularMIX All rights reserved. https://www.angularmix.com Sails Solves These

Notas do Editor

  1. https://nodejs.org/static/images/logos/nodejs-new-pantone-black.png
  2. http://www.robinsonfirm.com/wp-content/themes/attorney/photos/roadway-design-lawyer.jpg Rules to say how to handle incoming request Work with HTTP and WebSockets Two types:  automatic (or "implicit") custom (or "explicit")
  3. http://zdnet3.cbsistatic.com/hub/i/2014/11/28/dd55490d-76b3-11e4-b569-d4ae52e95e57/3451ad4c361a98b89fe2fe9f9fdec94f/amazon-vs-oracle-a-database-war.png Uses Waterline ORM Uses models to represent tables and relationships Can mix and match models between data stores Pre-configured to use JSON file store
  4. https://media.licdn.com/mpr/mpr/AAEAAQAAAAAAAAZ5AAAAJDcyNjRhOWEzLTYzMDktNGJiZC05YTcwLTg5MzkyNjJiNTdkZg.jpg
  5. https://i.kinja-img.com/gawker-media/image/upload/s--uFoN6YYf--/c_scale,fl_progressive,q_80,w_800/jgpeuoavmn7pwbh98ycs.jpg Implemented using policies Can use any scheme Apply to individual action or entire controller Designed to be chained together
  6. http://mean.io/wp-content/themes/twentysixteen-child/images/express.png
  7. http://inlight.com.au/img/blog-main/main-how-to-make-your-website-load-ridiculously-fast.jpg http://1.bp.blogspot.com/-V6bdiIwfZxs/VXH1VbwOh8I/AAAAAAAAAw8/61Jt-OuuT98/s1600/Speedy.png
  8. https://pbs.twimg.com/profile_images/53902894/jwnhlogo02_logoonly.png
  9. http://goodheads.io/wp-content/uploads/2016/02/magic_method_bulb.jpg
  10. https://appeltechsolutions.com/wp-content/uploads/2013/06/free.jpg
  11. https://nodejs.org/static/images/logos/nodejs-new-pantone-black.png
  12. Done