try {
await env.DB.prepare(
"INSERT INTO accesslog (ip, time, path) VALUES (?1, ?2, ?3)"
).bind(ip, time, pathname).run();
} catch (error) {
console.error(`Error while inserting row into accesslog table: ${error}`);
return Response.json({ message: `Error while inserting row into accesslog table: ${error.message}` });
}
}
try {
await env.DB.prepare(
"INSERT INTO accesslog (ip, time, path) VALUES (?1, ?2, ?3)"
).bind(ip, time, pathname).run();
} catch (error) {
console.error(`Error while inserting row into accesslog table: ${error}`);
return Response.json({ message: `Error while inserting row into accesslog table: ${error.message}` });
}
}