aziontech/bundler

feat: Omitting the Requirement of AZION.VERSION_ID in assets fetch (handler.js)

jotanarciso opened this issue · 0 comments

Description:

Currently, the handler requires the explicit insertion of a version_id to specify the desired version of the API. This can be burdensome for developers and may lead to errors if the version_id is not provided correctly. To improve the developer experience and ensure seamless integration with the API, we need to eliminate the mandatory requirement of version_id in the handler. Instead, the handler should automatically fetch the latest version of the API.

The goal of this issue is to modify the handler logic to eliminate the need for explicit insertion of version_id and establish a collaboration with the API team to ensure that the handler always fetches the latest version of the API.

Current API example:

import { mountSPA } from "#edge";

  try {
    const myApp = mountSPA(event.request.url, AZION.VERSION_ID);
    const response = await fetch(myApp)
    return response;
  } catch (e) {
    return new Response(e.message || e.toString(), { status: 500 });
  }

Wanted

import { mountSPA } from "#edge";

  try {
    const myApp = mountSPA(event.request.url;
    const response = await fetch(myApp)
    return response;
  } catch (e) {
    return new Response(e.message || e.toString(), { status: 500 });
  }