but this is in the geaders tho ```ts const fetch_headers = { 'User-Agent': `${fitweather_credent
but this is in the geaders tho
const fetch_headers = {
'User-Agent': `${fitweather_credentials.name}/1.0 (Florida Institute of Technology Weather Discord Bot (Student Run), https://github.com/DaBigBlob/FIT-Weather-Chan)`,
'Accept': "application/geo+json"
};if(!proto_res?.properties?.periods) with optional chaining.properties.periods would throw a TypeError if properties doesn't exist. For example:
performance.now() isn’t available in Workers and Date.now() doesn’t increment unless you do I/O is there any way to actually benchmark CPU bound function execution times in a worker?performance.now() is available but it just calls Date.now()internal server error anyplace to look to see better logging?app.onError to add your own handlerproduction stuff on the dashboard entirely right now
if(!proto_res?.properties?.periods).properties.periodsTypeErrorpropertiesperformance.now()performance.now()Date.now()Date.now()internal server errorapp.onErrorproductionexport function exists<T>(data: T|null|undefined): data is T {
if (
(data === null) ||
(data === undefined)
) return false;
return true;
}const obj = {foo: 'bar'}
console.log(obj.foo) // bar
console.log(obj.bar) // undefined
console.log(obj.bar.baz) // TypeErrorimport { Hono } from 'hono'
import { Client } from 'pg'
const app = new Hono()
const connstring = "postgresql://postgres@localhost:5432/hhscdev?schema=public"
app.get('*', async (c) => {
const client = new Client("postgresql://postgres@localhost:5432/hhscdev?schema=public");
await client.connect();
const { rows: [{ now }] } = await client.query('select now();');
return c.text(`Hello Hono! ${now}`)
})
export default app