-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate v3 programming model to v4 related with PR - #174 #231
Migrate v3 programming model to v4 related with PR - #174 #231
Conversation
… winston-transport)
@manekinekko now is finally done! |
@glaucia86 can you also add a readme.md file under packages/api-v4/ explaning how to start the new API? (similarily to packages/api/README.md). Some steps are necessary for the new API to execute, for instance renaming |
fix: following up code review
fix: following up the code review
…glaucia86/contoso-real-estate into feat/migrate-v3-to-v4-functions
@manekinekko I made the changes as asked. Thanks a lot :) |
… into feat/migrate-v3-to-v4-functions
great PR and related blog post! I have a question and one feedback:
|
import { postCheckout } from "./functions/checkout"; | ||
|
||
//#region User Function | ||
app.get("get-users", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this index.ts
file aggregating the bindings from the functions. It loosens the coupling between the endpoints and the Azure Function infrastructure a bit.
It also makes it easier to see the possibility of generating functions or bindings based on convention. I've always wished we could Railsify the creation of Azure Functions.
Hi, @gabrieljoelc. How are you? Unfortunately, it was a feature that should have been delivered as soon as possible due to the recent release. However, if you'd like to know more details about how a particular function was implemented, you can check out this blog I wrote with a step-by-step guide: HERE About the |
Azure-Samples#231) * feat(api-v4): initial commit with v4 programming model httpTriggerTest.ts * fix(api-v4): removing unecessary console.log * chore(api-v4): install new dependecies and devdependecies * chore(api-v4): development of the 'User' schema * refactor(api-v4): create 'User' interface * fix(api-v4): fixing import file path * fix(api-v4): fixing import file path * chore(api-v4): initialize the getUser.ts development * fix(api-v4): fix typo * chore(api-v4): include schema templates * chore(api-v4): modified 'tsconfig.json' file config * chore(api-v4): install new packages (applicationinsights, winston and winston-transport) * fix(api-v4): remove unecessary comments * chore(api-v4): dcreate interfaces in 'appConfig.ts' * chore(api-v4): development of mongoose configuration - WIP * chore(api-v4): development of the 'observability.ts'services - WIP * chore(api-v4): development of the Winston Transports and App Insights config - WIP * fix(api-v4): remove unecessary file * refactor(api-v4): using type inferece to refactor the file * chore(api-v4): changing the typescript version * chore(api-v4): development of the 'applicationInsightsTransports' * fix(api-v4): typo * fix(api-v4): renaming the function from 'getUsers' to 'users' * chore(api-v4): migrating 'get-users'(v3) to 'users' (v4) functions * chore(api-v4): migrating 'get-user-by-id'(v3) to 'user' (v4) functions * chore(api-v4): development of the 'observability' file * chore(api-v4): finish development of the 'mongoose.ts' file * chore(api-v4): install packages: pg,azure-key-vault, aad * chore(api-v4): development of the postgres database configuration * chore(api-v4): development of the 'index.ts' file from 'config' folder * chore(api-v4): including the '.env_example' and 'openapi.yaml' files * chore(api-v4): development of the 'payment.schema.ts' file * chore(api-v4): development of the 'payment.ts' file * fix(api-v4): modify method name * fix(api-v4): style typo * chore(api-v4): migration from v3 to v4 from: 'get-payment-by-id' function * chore(api-v4): add 'toUpperCase for get secret names * chore(api-v4): rename the function's name * chore(api-v4): create new files for refactor * chore(api-v4): development of middleware for api-v4 * refactor(api-v4): refactoring the new api-v4 * fix(api-v4): some important changes * chore(api-v4): include TODO for 'initializeDatabaseConfiguration' method * chore(api-v4): development of the get-payments function * chore(api-v4): development of the get-payments function * chore(api-v4): include 'local.settings.sample.json' and removed 'NOTES.md' file from .gitignore * chore(api-v4): development of the 'reservation.schema.ts' file * refactor(api-v4): applied refactor in the 'updatePaymentStatus' method * chore(api-v4): development of the 'reservation.ts' file * chore(api-v4): development of the 'reservation-request.ts' file * chore(api-v4): development of the models: 'favorite' and 'listing' * chore(api-v4): include ObjectId from mongoose in the 'getListingById' method * chore(api-v4): development of the 'get-reservation-by-id' function from v3 to v4 * fix(api-v4): fix typo * chore(api-v4): development of the 'get-reservation' function from v3 to v4 * fix(api-v4): fix typo * chore(api-v4): include a typescript flag in the 'start' script cmd * chore(api-v4): development of the 'get-favorites' function from v3 to v4 * chore(api-v4): changing the tsconfig.json according from the 'api' * chore(api-v4): change the 'routePrefix' * chore(api-v4): update 'local.settings.sample.json' file * chore(api-v4): removing header * chore(api-v4): development of the 'get-listing-by-id' function from v3 to v4 * chore(api-v4): development of the 'get-listing' function from v3 to v4 * chore(api-v4): development of the 'openapi' function from v3 to v4 * chore(api-v4): returning with interfaces * chore(api-v4): development of the 'post-user' function from v3 to v4 * chore(api-v4): development of the 'post-payment' function from v3 to v4 * refactor(api-v4): create 'isValidPayment' to refactor 'postPayment' function * chore(api-v4): development of the 'post-favorite' function from v3 to v4 * fix(api-v4): return with interfaces in reservation * chore(api-v4): development of the 'checkout' function from v3 to v4 * chore(api-v4): include the same pattern for error messages * chore(api-v4): development of the 'delete-favorite' function from v3 to v4 * refactor(api-v4): return with interfaces - Favorite * chore(api-v4): development of the 'patch-reservation-by-id' function from v3 to v4 * fix(api-v4): returning with interfaces 'Payment' * chore(api-v4): including a pattern for error messages * chore(api-v4): removing unecessary file and function * chore(api-v4): remove header and unecessary file * fix(api-v4): change from 'console' to 'context' * refactor(api-v4): include a type 'DeleteFavoriteRequestBody' * refactor(api-v4): include try-catch block * chore(api-v4): including packages according to the 'api' * fix(api-v4): rename the '.env.template' file * fix(api-v4): rename the file * fix(api-v4): changes in the '.gitignore' file * chore(api-v4): added some new config to be ignored in the application * fix(api-v4): remove unecessary ignored config * fix(api-v4): change 'routePrefix' * fix(api-v4): update '@azure/functions' package * fix(api-v4): removed the conversion * chore(api-v4): add comment * chore: include the 'api-v4' in the main package.json file * chore: update the 'package-lock.json' file * chore: important update in the 'applicationinsights' package * chore: include double quotes * chore: include the application insights transport importation * chore: update the 'local.settings.json' file * feat(api-v4): initial commit with v4 programming model httpTriggerTest.ts * fix(api-v4): removing unecessary console.log * fix(api-v4): removing unecessary console.log * chore(api-v4): install new dependecies and devdependecies * chore(api-v4): development of the 'User' schema * refactor(api-v4): create 'User' interface * fix(api-v4): fixing import file path * fix(api-v4): fixing import file path * chore(api-v4): initialize the getUser.ts development * fix(api-v4): fix typo * chore(api-v4): include schema templates * chore(api-v4): modified 'tsconfig.json' file config * chore(api-v4): install new packages (applicationinsights, winston and winston-transport) * fix(api-v4): remove unecessary comments * chore(api-v4): dcreate interfaces in 'appConfig.ts' * chore(api-v4): development of mongoose configuration - WIP * chore(api-v4): development of the 'observability.ts'services - WIP * chore(api-v4): development of the Winston Transports and App Insights config - WIP * fix(api-v4): remove unecessary file * refactor(api-v4): using type inferece to refactor the file * chore(api-v4): changing the typescript version * chore(api-v4): development of the 'applicationInsightsTransports' * fix(api-v4): typo * fix(api-v4): renaming the function from 'getUsers' to 'users' * chore(api-v4): migrating 'get-users'(v3) to 'users' (v4) functions * chore(api-v4): migrating 'get-user-by-id'(v3) to 'user' (v4) functions * chore(api-v4): development of the 'observability' file * chore(api-v4): finish development of the 'mongoose.ts' file * chore(api-v4): install packages: pg,azure-key-vault, aad * chore(api-v4): development of the postgres database configuration * chore(api-v4): development of the 'index.ts' file from 'config' folder * chore(api-v4): including the '.env_example' and 'openapi.yaml' files * chore(api-v4): development of the 'payment.schema.ts' file * chore(api-v4): development of the 'payment.ts' file * fix(api-v4): modify method name * fix(api-v4): style typo * chore(api-v4): migration from v3 to v4 from: 'get-payment-by-id' function * chore(api-v4): add 'toUpperCase for get secret names * chore(api-v4): rename the function's name * chore(api-v4): create new files for refactor * chore(api-v4): development of middleware for api-v4 * refactor(api-v4): refactoring the new api-v4 * fix(api-v4): some important changes * chore(api-v4): include TODO for 'initializeDatabaseConfiguration' method * chore(api-v4): development of the get-payments function * chore(api-v4): development of the get-payments function * chore(api-v4): include 'local.settings.sample.json' and removed 'NOTES.md' file from .gitignore * chore(api-v4): development of the 'reservation.schema.ts' file * refactor(api-v4): applied refactor in the 'updatePaymentStatus' method * chore(api-v4): development of the 'reservation.ts' file * chore(api-v4): development of the 'reservation-request.ts' file * chore(api-v4): development of the models: 'favorite' and 'listing' * chore(api-v4): include ObjectId from mongoose in the 'getListingById' method * chore(api-v4): development of the 'get-reservation-by-id' function from v3 to v4 * fix(api-v4): fix typo * chore(api-v4): development of the 'get-reservation' function from v3 to v4 * fix(api-v4): fix typo * chore(api-v4): include a typescript flag in the 'start' script cmd * chore(api-v4): development of the 'get-favorites' function from v3 to v4 * chore(api-v4): changing the tsconfig.json according from the 'api' * chore(api-v4): change the 'routePrefix' * chore(api-v4): update 'local.settings.sample.json' file * chore(api-v4): removing header * chore(api-v4): development of the 'get-listing-by-id' function from v3 to v4 * chore(api-v4): development of the 'get-listing' function from v3 to v4 * chore(api-v4): development of the 'openapi' function from v3 to v4 * chore(api-v4): returning with interfaces * chore(api-v4): development of the 'post-user' function from v3 to v4 * chore(api-v4): development of the 'post-payment' function from v3 to v4 * refactor(api-v4): create 'isValidPayment' to refactor 'postPayment' function * chore(api-v4): development of the 'post-favorite' function from v3 to v4 * fix(api-v4): return with interfaces in reservation * chore(api-v4): development of the 'checkout' function from v3 to v4 * chore(api-v4): include the same pattern for error messages * chore(api-v4): development of the 'delete-favorite' function from v3 to v4 * refactor(api-v4): return with interfaces - Favorite * chore(api-v4): development of the 'patch-reservation-by-id' function from v3 to v4 * fix(api-v4): returning with interfaces 'Payment' * chore(api-v4): including a pattern for error messages * chore(api-v4): removing unecessary file and function * chore(api-v4): remove header and unecessary file * fix(api-v4): change from 'console' to 'context' * refactor(api-v4): include a type 'DeleteFavoriteRequestBody' * refactor(api-v4): include try-catch block * chore(api-v4): including packages according to the 'api' * fix(api-v4): rename the '.env.template' file * fix(api-v4): rename the file * fix(api-v4): changes in the '.gitignore' file * chore(api-v4): added some new config to be ignored in the application * fix(api-v4): remove unecessary ignored config * fix(api-v4): change 'routePrefix' * fix(api-v4): update '@azure/functions' package * fix(api-v4): removed the conversion * chore(api-v4): add comment * chore: include the 'api-v4' in the main package.json file * chore: update the 'package-lock.json' file * chore: important update in the 'applicationinsights' package * chore: include double quotes * chore: include the application insights transport importation * chore: update the 'local.settings.json' file * chore: include '@apollo/client' package * fix: follow up the code review * chore: install 'apollo/client' * Update flexibleserver.bicep fix: following up code review * Update main.bicep fix: following up the code review * fix: remove unecessary space * fix: following up the code review * docs: include README.md file under api-v4 folder * docs: update the README.md under api-v4 folder * fix: following up the code review * chore: running npm i command * chore: update '@azure/functions' and '@ApplicationInsights' packages for release v4 * chore: execute 'npm run format' command * docs: include the README.md according from the main branch --------- Co-authored-by: Julien Dubois <julien.dubois@gmail.com> Co-authored-by: Natalia Venditto <nataliafrontend@gmail.com>
Hi, folks.
This issue is related with #174.
cc: @manekinekko @anfibiacreativa