Skip to content

🧟 Monster as a Service. A Netlify Function which returns a random D&D moster every time.

Notifications You must be signed in to change notification settings

atilafassina/monster-as-a-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧟 Monster As A Service (MAAS)

Netlify Status

This is a microservice wrapping requests to D&D 5e API.

It will return a random monster at every request.

Goal

This repository is an example use-case on how to use Netlify Functions with TypeScript.

Watch the video on Youtube

Deploy your own instance

Deploy MAAS to Netlify

More instructions

If you need help understanding the ins and outs of this code, please refer to the video on ScopeLeak

Packages

Dependencies Why
Netlify Dev¹ To run Netlify Functions locally
Netlify Lambda Adds build-step to Netlify Functions
TypeScript The compiler for TypeScript (tsc)
node-fetch Brings window.fetch api to NodeJS
babel/preset-env Tells Babel which JavaScript syntax to output
babel/preset-typescript Teach Babel to use TypeScript compiler
types/aws-lambda Request/Response types for AWS Lambdas²
encoding depency of node-fetch³

1: Install it globally on your system

2: Netlify Functions uses AWS Lambdas under the hood

3: It should be a dependency of node-fetch but it’s not added in v2, so we add manually so our build doesn‘t break.

About

🧟 Monster as a Service. A Netlify Function which returns a random D&D moster every time.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published