Nothing too crazy here. Just a Bootstrap navbar with a fink back to the home page. The span is
one of the Bootstrap glvphicons.
views/partials/footerejs
We have created a link to the image on Instagram. We also have an instagran-bar to display
the number of likes and comments,
By loping over the grams object, we have access to everything that was retumed by the API.
You can use the API explorer to look through the data and call the necessary items,
For the image, we are using images.standard_resolution-uri and for likes and comments
respectively, We can Use 1ixes.count and comments. count.
If we wanted information about the user, we could use user.usernane and
user.profile_picture, The caption can be grabbed using caption. cox:Last step isto style up our images. Add the following to your styie.css file:
instagram-pic |
position:relative:
padding: 10pxs
overflow:hidden;
,
sinstagran-pic ing {
padding: 5px;
border-radius:2px;
box-shadow:0 0 Spx rgba(0, 0, 0, 0.5)
,
sinstagram-bar {
position:absolute;
bottom: 30px7
width:100%;
lere:0;
padding-left :30px:
padding-right :30px;
color: AFFE;
instagran-bar span |
margin-right :5px:
,
sinstagran-bar likes {
float: left;
,
instagram-bar .conments
Float:rights
,
Finally we have our app with the popular Instagram images'Conclusion
To recap, we've learned a bit about how Node works and why i's so neat, We've also been able
to:
Process a JS file with Node
Install packages using npm
Create an HTTP server with Node and Express
Used a package to grab API data
‘Templated an application with EJS
Displayed data with EJS
The concepts here can apply to many different types of applications. Play around with the many
packages available on npm. The possbilties of what can be done with Node are endless.
You can pair it with a frontend fiamework like Angular and a database system like MongoDB to
create a MEAN Stack application, For more information on that, check out Scotch School
where we'll be covering fill ideo courses on popular topies like Node, JavaScript, Angular, and
more.
For more Node and JavaScript tutorials, be sure to check out scotch.jo as we update weeklywith new articles and video courses,