-
Notifications
You must be signed in to change notification settings - Fork 339
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
remove api prefix from routes #280
remove api prefix from routes #280
Conversation
WalkthroughThe overall change involves a reconfiguration of API routing and CORS settings, alongside updates to client-side components and pages. API routes are now defined without a specific 'api' prefix and apply middleware directly. CORS policy has been broadened to include all paths. Client-side updates reflect these routing changes, with endpoints adjusted accordingly. Additionally, there's a shift in handling certain server routes like Stripe and Vapor webhooks, file uploads, and certificate serving, which are now present in the API routes file. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (13)
- app/Providers/RouteServiceProvider.php (1 hunks)
- client/components/open/forms/components/FormSubmissions.vue (2 hunks)
- client/components/pages/auth/ForgotPasswordModal.vue (1 hunks)
- client/components/pages/forms/create/CreateFormBaseModal.vue (1 hunks)
- client/components/pages/forms/show/FormQrCode.vue (1 hunks)
- client/components/pages/forms/show/RegenerateFormLink.vue (1 hunks)
- client/pages/auth/password/email.vue (1 hunks)
- client/pages/auth/password/reset.vue (1 hunks)
- client/pages/forms/[slug]/show.vue (1 hunks)
- client/pages/settings/admin.vue (2 hunks)
- config/cors.php (1 hunks)
- routes/api.php (2 hunks)
- routes/web.php (2 hunks)
Files skipped from review due to trivial changes (4)
- client/components/pages/auth/ForgotPasswordModal.vue
- client/components/pages/forms/show/FormQrCode.vue
- client/pages/auth/password/reset.vue
- client/pages/forms/[slug]/show.vue
Additional comments: 13
config/cors.php (1)
- 18-18: The CORS
paths
configuration has been changed to allow all paths. Confirm that this broadening of the CORS policy is intentional and that appropriate security measures are in place to protect against potential cross-origin attacks.client/pages/auth/password/email.vue (1)
- 45-45: The endpoint URL in the
send
method has been updated to remove the/api
prefix, which is consistent with the PR's objective to refactor the routing system.app/Providers/RouteServiceProvider.php (1)
- 43-45: The route declaration in the
boot
method has been modified to remove theprefix('api')
and apply only themiddleware('api')
, which aligns with the PR's objective to remove the 'api' prefix from routes.client/pages/settings/admin.vue (1)
- 57-58: The URLs for stats and horizon pages are now generated using
runtimeConfig
, which reflects the removal of the 'api' prefix and is consistent with the PR's objective.client/components/pages/forms/show/RegenerateFormLink.vue (1)
- 98-98: The
formEndpoint
computed property has been updated to remove the/api
prefix, which is consistent with the PR's objective to refactor the routing system.client/components/pages/forms/create/CreateFormBaseModal.vue (1)
- 123-123: The endpoint URL in the
generateForm
method has been updated to remove the/api
prefix, which is consistent with the PR's objective to refactor the routing system.client/components/open/forms/components/FormSubmissions.vue (1)
- 104-105: The addition of
runtimeConfig
to the returned object in thesetup
function and the modification of theexportUrl
method to useruntimeConfig.public.apiBase
are consistent with the PR's objective.routes/api.php (6)
21-23: New imports for
Illuminate\Http\Request
,Illuminate\Http\Response
, andIlluminate\Support\Facades\Storage
have been added. Verify that these imports are used in the routes defined in this file and that their addition is intentional.187-189: A new route for handling Stripe webhooks has been added. Ensure that the webhook handling is secure and that the
handleWebhook
method properly validates and processes the incoming webhook requests.192-194: A new route for handling Vapor signed storage URLs has been added. Confirm that the middleware applied to this route is appropriate and that the
store
method securely handles the signed storage URL creation.196-198: A new route for uploading files has been added. Ensure that the file upload process is secure, that proper validation is in place, and that the
upload
method handles the file data correctly.200-207: A new route for serving temporary local files has been added. Verify that the route securely serves files, that the signature is validated, and that the correct MIME type is set in the response headers.
209-210: A new route for handling Caddy certificate requests has been added. Confirm that the
ask
method and theCaddyRequestMiddleware
middleware are correctly implemented to handle certificate requests securely.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- app/Providers/RouteServiceProvider.php (1 hunks)
- routes/web.php (2 hunks)
Additional comments: 2
routes/web.php (1)
- 1-6: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [1-11]
The provided snippet of
routes/web.php
does not show any changes, but based on the PR objectives and the AI-generated summary, it seems that route definitions and certain imports have been removed. Please ensure that all necessary route definitions have been appropriately migrated toroutes/api.php
and that the removal of imports does not affect any remaining routes in this file.app/Providers/RouteServiceProvider.php (1)
- 43-43: The changes to the
boot
method inRouteServiceProvider.php
reflect the removal of the 'api' prefix from routes and the direct application of the 'api' middleware. This aligns with the PR objectives. However, ensure that all routes previously under the 'api' middleware are still functioning as expected and that no routes require the 'spa' middleware that has been removed.
* wip * Managed to load a page * Stuck at changing routes * Fixed the router, and editable div * WIP * Fix app loader * WIP * Fix check-auth middleware * Started to refactor input components * WIP * Added select input, v-click-outside for vselect * update vselect & phone input * Fixed the mixin * input component updates * Fix signature input import * input component updates in vue3 * image input in vue3 * small fixes * fix useFormInput watcher * scale input in vue3 * Vue3: migrating from vuex to Pinia (#249) * Vue3: migrating from vuex to Pinia * toggle input fixes * update configureCompat --------- Co-authored-by: Forms Dev <[email protected]> * support vue3 query builder * Refactor inpus * fix: Vue3 Query Builder - Logic Editor (#251) * support vue3 query builder * upgrade * remove local from middleware * Submission table pagination & migrate chart to vue3 (#254) * Submission table Pagination in background * migrate chart to vue3 * Form submissions pagination * Form submissions * Fix form starts * Fix openSelect key issue --------- Co-authored-by: Forms Dev <[email protected]> Co-authored-by: Julien Nahum <[email protected]> * Vue 3 better animation (#257) * vue-3-better-animation * Working on migration to vueuse/motion * Form sidebar animations * Clean code * Added animations for modal * Finished implementing better animations --------- Co-authored-by: Forms Dev <[email protected]> * Work in progress * Migrating amplitude and crisp plugin/composable * Started to refactor pages * WIP * vue3-scroll-shadow-fixes (#260) * WIP * WIP * WIP * Figured out auth & middlewares * WI * Refactoring stores and templates pages to comp. api * Finishing the templates pages * fix collapsible * Finish reworking most templates pages * Reworked workspaces store * Working on home page and modal * Fix dropdown * Fix modal * Fixed form creation * Fixed most of the form/show pages * Updated cors dependency * fix custom domain warning * NuxtLink migration (#262) Co-authored-by: Forms Dev <[email protected]> * Tiny fixes + start pre-rendering * migrate-to-nuxt-useappconfig (#263) * migrate-to-nuxt-useappconfig * defineAppConfig --------- Co-authored-by: Forms Dev <[email protected]> * Working on form/show and editor * Globally import form inputs to fix resolve * Remove vform - working on form public page * Remove initform mixin * Work in progress for form create guess user * Nuxt Migration notifications (#265) * Nuxt Migration notifications * @input to @update:model-value * change field type fixes * @update:model-value * Enable form-block-logic-editor * vue-confetti migration * PR request changes * useAlert in setup * Migrate to nuxt settings page AND remove axios (#266) * Settings pages migration * remove axios and use opnFetch * Make created form reactive (#267) * Remove verify pages and axios lib --------- Co-authored-by: Julien Nahum <[email protected]> * Fix alert styling + bug fixes and cleaning * Refactor notifications + add shadow * Fix vselect issue * Working on page pre-rendering * Created NotionPages store * Added sitemap on nuxt side * Sitemap done, working on aws amplify * Adding missing module * Remove axios and commit backend changes to sitemap * Fix notifications * fix guestpage editor (#269) Co-authored-by: Julien Nahum <[email protected]> * Remove appconfig in favor of runtimeconfig * Fixed amplitude bugs, and added staging environment * Added amplify file * Change basdirectory amplify * Fix loading bar position * Fix custom redirect (#273) * Dirty form handling - nuxt migration (#272) * SEO meta nuxt migration (#274) * SEO meta nuxt migration * Polish seo metas, add defaults for OG and twitter --------- Co-authored-by: Julien Nahum <[email protected]> * migrate to nuxt useClipboard (#268) * Set middleware on pages (#278) * Se middleware on pages * Se middleware on account page * add robots.txt (#276) * 404 page migration (#277) * Templates pages migration (#275) * NuxtImg Migration (#279) Co-authored-by: Julien Nahum <[email protected]> * Update package json * Fix build script * Add loglevel param * Disable page pre-rendering * Attempt to allow svgs * Fix SVGs with NuxtImage * Add .env file at AWS build time * tRGIGGER deploy * Fix issue * ANother attrempt * Fix typo * Fix env? * Attempt to simplify build * Enable swr caching instead of prerenderign * Better image compression * Last attempt at nuxt images efficiency * Improve image optimization again * Remove NuxtImg for non asset files * Restore templates pages cache * Remove useless images + fix templates show page * image optimization caching + fix hydratation issue form template page * URL generation (front&back) + fixed authJWT for SSR * Fix composable issue * Fix form share page * Embeddable form as a nuxt middleware * Fix URL for embeddable middleware * Debugging embeddable on amplify * Add custom domain support * No follow for non-production env * Fix sentry nuxt and custom domain redirect * remove api prefix from routes (#280) * remove api prefix from routes * PR changes --------- Co-authored-by: Julien Nahum <[email protected]> * nuxt migration -file upload - WIP (#271) Co-authored-by: Julien Nahum <[email protected]> * Fix local file upload * Fix file submissions preview * API redirect to back-end from nuxt * API redirect to back-end from nuxt * Remove old JS app, update deploy script * Fix tests, added gh action nuxt step * Updated package-lock.json * Setup node in GH Nuxt action * Setup client directory for GH workflow --------- Co-authored-by: Forms Dev <[email protected]> Co-authored-by: Chirag Chhatrala <[email protected]> Co-authored-by: Rishi Raj Jain <[email protected]> Co-authored-by: formsdev <[email protected]>
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Documentation
Style
Chores