loading...
Cover image for How I Built a Serverless Function Without Knowing It, I Think*

How I Built a Serverless Function Without Knowing It, I Think*

aunyks profile image Gerald Nash ⚡️ ・3 min read

It’s the weekend after a week full of exams. I’m exhausted and am just waiting to graduate high school. But, like any other developer I feel the urge to go ahead and start another weekend project. I’m learning some pretty interesting stuff in AP Calculus, but I get tired of doing algebra during homework at times. I think to myself: Why not build something that does my math homework for me?

Not a Bad Idea

That’s where I got the idea to build Newton, a really micro micro-service for math. I wanted to make it easier for developers to do math without being constrained by codebase sizes or non-existant APIs in their preferred language.

Newton API Front Page

So what makes it interesting? Other then being super cool and functional, of course, Newton requires no storage space other than its source files. It doesn’t access or modify a database, and it doesn’t even dynamically create configuration files or any of the matter. Each request and response is protected by Zeit Now’s HTTPS encryption. Plus, it runs solely on simple GET requests.

I didn’t think much of those characteristics, but after a bit of interaction with the tech community I think Newton is a serverless function.

Eric Elliott gave an unexpected yet informative response. Newton fits those characteristics. Zeit abstracts global hosting for Now, so that satisfies the machines on a network. Newton is a relatively small package (~3.3kB), so that fits the small brain, and like I said it doesn’t access or process persistant memory. Seems like serverless to me.

Shoulder Shrug

Anything else?

That seals the deal. I use Now, because I don’t have to worry about anything other than how my code runs. And, Newton does one thing: math.

Wait, math is a lot of things.

Hmm...

We get the point. But just to be sure, I took to r/serverless.

My Reddit Question

Eh, that answer is good enough for me.

Why not?

So, in the end I built a small serverless function as a weekend project to help me do my math homework and help others make cool things. Newton has grown to become more popular than I initially expected, and I‘d love to witness its expansion and see what others make with it.

And don’t forget: it’s serverless, I think.

You're Awesome

Thanks for reading! As always, you’re awesome.

For more information on serverless architecture, start here.

Posted on by:

Discussion

pic
Editor guide
 

The GIFs are so distracting and annoying I couldn't read the whole thing...

 

how is a publicly accessible and hosted API anywhere near serverless ...
I mean WTF ...

 

I don't think you understand what serverless means in modern web development.

 

So it's basically a pure function you hooked up to a webservice...Serverless seems like a silly term though (clearly there's a server involved) stateless maybe? Or even stackless?

But in any case it's really cool and you can scale that shit into oblivion at super tiny costs! Nice work :)

 

So, another definition of serverless might be "it's not only 'share nothing', but 'nothing to share'?" :)

 

This is really cool! Love the simplicity and the GIFs to explain above 😉👍