@analogjs/router
Version:
Filesystem-based routing for Angular
40 lines (37 loc) • 876 B
JavaScript
function fail(status, errors) {
return new Response(JSON.stringify(errors), {
status,
headers: {
'X-Analog-Errors': 'true',
},
});
}
function json(data, config) {
return new Response(JSON.stringify(data), {
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
...config,
});
}
function redirect(url, config = 302) {
if (typeof config === 'number') {
return new Response(null, {
status: config,
headers: {
Location: `${url}`,
},
});
}
return new Response(null, {
headers: {
Location: `${url}`,
},
...config,
});
}
/**
* Generated bundle index. Do not edit.
*/
export { fail, json, redirect };
//# sourceMappingURL=analogjs-router-server-actions.mjs.map