EdwardRutz / node-pizzeria-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serverless Node.js API for a Pizzeria

A Node.js API for a pizzeria to use with AWS Lambda

API Features and Routes

  • Lists all pizzas
  • Look up pizza orders
  • Create, update and cancel pizza orders

Dependencies

  • Node.js
  • Claudia.js, npm install claudia -g
  • claudia-api-builder, npm install claudia-api-builder --save
  • claudia-bot-builder, npm install claudia-bot-builder --save
  • AWS Lambda
  • AWS CLI

API Routes Examples

Notes

  • To semi-colon or not to semi-colon? For a change, not using semi-colons to terminate statements
  • When not using semi-colons in JS to end statements, just make sure that any line beginning with parenthesis has a semi-colon in front of it.
    • ie ;(d + e).print()
    • This avoids the statement from being added to the statement before it.
  • 'claudia-api-builder' does not work as a variable name for the import/require statement.
  • Claudia adds a configuration file, "claudia.json," to root directory. Don't change it.
  • For parameters that change(dynamic parameters), Claudia.js uses curly brackets {id} and express.js uses a colon (:id)
  • With each change, update the Lambda function via Claudia.js, run claudia update
  • It is a good practice to put a message at the root path of an API so a friendly message is returned instead of an error api.get("/", () => 'Welcome to Pizza API')

Sources

About


Languages

Language:JavaScript 100.0%