Review your Azure Functions application
Congratulations! You completed your Azure Functions application by shifting your Node.js Express code and making minimal changes. Next, review the structure of your application.
What you learned about Shifting from Express to Azure Functions
Now, reflect on what steps you followed to refactor your code from Node.js Express to Azure Functions. I this module, you:
- Created the Azure Functions application
- Created a function for every route endpoint
- Set the method for each endpoint in the function's function.json file
- Named each endpoint in the function's function.json file
- Copied the Node.js Express services from the server/services folder to the functions folder
- Imported the Functions host
- Used destructuring to access the request and response objects
- Added code to each function to call the appropriate service
Azure Functions and Folders
The Azure Functions application has folders that map to each of their appropriate endpoints, as shown below.
The structure of the Azure Functions application contained in the functions folder should look like the following file structure.
functions | - vacations-delete | | - function.json | | - index.ts | - vacations-get | | - function.json 👈 The vacation route's configuration | | - index.ts 👈 The vacation routes | - vacations-post | | - function.json | | - index.ts | - vacations-put | | - function.json | | - index.ts | - services 👈 The same folder that the Express app has | | - data.ts 👈 The vacation data (could be database API calls) | | - index.ts | | - vacation.service.ts 👈 The logic to get the vacation data | - .funcignore | - .gitignore | - host.json | - local.settings.json | - package.json | - proxies.json | - tsconfig.json
Next, you'll run and debug your Angular application and Azure Functions application together.