Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
27 lines
721 B
Plaintext
27 lines
721 B
Plaintext
import { status as httpStatus } from 'http-status';
|
|
import { headersWithCors } from '../../utilities/headersWithCors.js';
|
|
import { accessOperation } from '../operations/access.js';
|
|
export const accessHandler = async (req)=>{
|
|
const headers = headersWithCors({
|
|
headers: new Headers(),
|
|
req
|
|
});
|
|
try {
|
|
const results = await accessOperation({
|
|
req
|
|
});
|
|
return Response.json(results, {
|
|
headers,
|
|
status: httpStatus.OK
|
|
});
|
|
} catch (e) {
|
|
return Response.json({
|
|
error: e
|
|
}, {
|
|
headers,
|
|
status: httpStatus.INTERNAL_SERVER_ERROR
|
|
});
|
|
}
|
|
};
|
|
|
|
//# sourceMappingURL=access.js.map |