Skip to content

Server Data #547

@do4ng

Description

@do4ng

I originally planned to make @zely-js/optimizer for server data, but it was canceled due to serpack limitations.
Instead, I am developing a different way to store server data, inspired by famous frontend frameworks.


function fn(ctx: StoreContext) {
  return `Hello ${ctx.params.id}`;
}

export default [
  GET(async (ctx) => {
    const { data, id } = await $store(fn);

    return data;
  }),
];

You can access the server data from other files through the unique ID value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions