The front is the new back

@mgonto

software developer

Auth0 Inc.

Javascript

Developer Advocate

Let me tell you about a day in my life

I had an idea for the OSCON conference

Create a quiz in which people can win Bitcoins

I finished the FrontEnd part but then...

send emails

connect to Coinbase API

make sure Bitcoins were redeemed once

connect to a MongoDB

To do all that I need a Backend API

Let's build a JS server

Setting up a JS server manually isn't easy

Let's install express

Express needs NodeJS installed

Let's install NodeJS

Which version should I install?

Now the app is finished

Where should I deploy this?

How do I deploy this?

How can I make it scale?

How can I make it secure?

I need to do soooo many things

Backend development

like FrontEnd development

send the email

from the FrontEnd

connect to Mongo

from the FrontEnd

call the Coinbase API

from the FrontEnd

How can we do that?

Let's go back to the basics

T-Shirt time

But now some questions arise...

Connection Strings, API Keys

secret

"server code"?

optimize and cache

"server code"?

send the "server code"

every request?

We'll come back to this, first let's see it in motion

curl \
  'http://127.0.0.1:3001/run'  \
   -H 'Content-Type: text/plain;charset=UTF-8' \
  --data-binary  \
  'return function(cb) {
    cb(null, "Hello world");
  }'

So what's the server now?

Demo time

Now, let's do it from a SPA

Demo time

But we also need to send some secrets sometimes.

Our email sender API requires a username and a password

T-Shirt time

Demo time

But wait, we're sending the code on every call

anybody can send code

runner

not performant

production

T-Shirt time

Demo time

I just want to code FrontEnd

https://webtask.io

WebTask Playground

Go to the website

Login with Github, Twitter or Facebook

Start playing ;)

Want examples, interesting videos & more info?

auze.ro/webtask-fec15

@mgonto

Front is the new back

@mgonto