A Node.js API for a pizzeria to use with AWS Lambda
- Lists all pizzas
- Look up pizza orders
- Create, update and cancel pizza orders
- 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
- Pizza Menu, https://sbb3t98b1e.execute-api.us-east-1.amazonaws.com/latest/menu
- A specific pizza (ID: 0-4), https://sbb3t98b1e.execute-api.us-east-1.amazonaws.com/latest/menu/1
- Root path with user friendly message and not an error code, https://sbb3t98b1e.execute-api.us-east-1.amazonaws.com/latest/
- 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.
- ie
- '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')