SlideShare a Scribd company logo
APIS FOR YOUR FRONTEND
BUILDING
Who?
Robert Ignat
Backend Developer
Used to work as a Frontend Developer
irobert91
@robertignat
linkedin.com/in/robertignat
What?
1. Reasons
2. Solutions
a. Sails example
3. monkepark
4. Q&A
Why?
∙ Node? JavaScript
∙ Monkeys?
Solutions
Mocking data
∙ Express - expressjs.com
∙ faker.js - github.com/marak/faker.js
Declaring data structure
∙ Sails.js - sailsjs.org
$ npm i -g sails
$ sails new myapp
$ cd myapp
$ sails generate api monkey
$ sails lift
monkepark
Building a monkey API
github.com/irobert91/monkepark-server for final version and steps
Questions?

More Related Content

PDF
Cloud Native PWAs (progressive web apps with Spring Boot and Angular) - DevNe...
PPT
The Best Open Source Application Development Tools
PPTX
JavaScript Metaprogramming with ES 2015 Proxy
PPTX
Netflix Winston meetup presentation 2015-11-18
PPTX
iSyndica - Building an API
PDF
WCSD - GutenWhat? A Gutenberg FAQ
PDF
Intro to JavaScript - LA - July
PDF
Build a Game with JavaScript - Pasadena July
Cloud Native PWAs (progressive web apps with Spring Boot and Angular) - DevNe...
The Best Open Source Application Development Tools
JavaScript Metaprogramming with ES 2015 Proxy
Netflix Winston meetup presentation 2015-11-18
iSyndica - Building an API
WCSD - GutenWhat? A Gutenberg FAQ
Intro to JavaScript - LA - July
Build a Game with JavaScript - Pasadena July

Recently uploaded (20)

PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
System and Network Administraation Chapter 3
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Nekopoi APK 2025 free lastest update
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
System and Network Administraation Chapter 3
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Designing Intelligence for the Shop Floor.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
CHAPTER 2 - PM Management and IT Context
Computer Software and OS of computer science of grade 11.pptx
Nekopoi APK 2025 free lastest update
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Softaken Excel to vCard Converter Software.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
Digital Systems & Binary Numbers (comprehensive )
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Migrate SBCGlobal Email to Yahoo Easily
Ad
Ad

Building APIs for your Frontend

Editor's Notes

  • #2: Welcome! In the next half hour or so I’ll be giving you an introduction to writing APIs in Node.js. If you haven’t done this before, don’t worry, this presentation is made for people with little to no experience in this subject.
  • #3: Moving on to the mandatory “who am I” page. I am Robert and I work as a Backend Developer for Jexia. I have previously worked as a Frontend Developer, using AngularJS mainly. Did that for a while in Jexia also, but ended up focusing on Backend and APIs. This is where you can find me. I’m not active on twitter, but if you send me any questions I will reply.
  • #4: Considering the scope of this meetup, I expect most of you to be frontend developers. I want to introduce you to backend programming by showing how to relatively simply create something that many of you use all the time: APIs. More precisely, we are going to mock some APIs. This technique can be useful if you are waiting for your backend colleagues to finish their part or just want to prototype something. After this presentation you should know at least where to start. We will begin by discussing some of the decisions regarding the project that we are going to build: monkepark, which is a simple simple webapp with information about some monkeys. Of course, we are only going to mock the backend. I will then present some solutions, alternatives to easily build APIs and then start writing some code for our monkey api. In the end, of course, we are going to have a Q&A session.
  • #5: So let’s see why… First of all, why Node? Why not PHP, Ruby or anything else? Because it’s JavaScript and it’s probably the easiest way for frontend developers to get into backend programming. You might also ask “Why Monkeys?” Because Apeldoorn is host to a large monkey park.
  • #6: When mocking APIs you mainly have 2 options: One is to declare the data structure. I will give you a short example using Sails, which is a node MVC framework (similar to Ruby on Rails or Laravel) that can generate REST APIs from your models. - example During sails installation: This will install the Sails framework and the CLI which we can use to create new projects or generate various parts of code, like models or controllers. On `sails lift`: Because sails handles schema migrations as well, we need to tell it what strategy to use. It will ask us now, but it’s easily configurable to avoid doing this on every “lift”. Another one is to use a smaller framework, like express, and to mock the data yourself. Although the second option needs more code/work, it is more flexible. Faker.js is a js library that can help “generate massive amounts of fake data” as they say. It is quite easy to use and it can be useful in this case as well, so I recommend that you check that out as well. An important thing to note is that in the Sails example data will be persisted and will be the same between server restarts, but in the next example (monkepark) data will reset to the original list each time.
  • #7: To illustrate what I mean, let’s start building an API for our monkeys. You can find the final version on github along with a step by step guide in the README as well as links to the various tools that we are going to use. Before we get started, how many of you use Node? If not many, ask about Grunt and Gulp. I am going to use node v4, but any version greater than 0.12 should work just fine. There is going to be a Q&A at the end, but if you have any questions, especially related to the code, please just interrupt so you don’t lag behind. If you are following along and get stuck you can also ask Dennis for help. Dennis! !! After each step ask if they are ready to move on. After all is done: If you know what Jexia does you will probably wonder why not use it. It’s because this presentation would last only 2 minutes.
  • #8: Be nice.