monster-as-a-service

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

Stars
8

Monster As A Service (MAAS)

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

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 its not added in v2, so we add manually so our build doesnt break.

Badges
Extracted from project README
Netlify Status Deploy MAAS to Netlify