US Congress Stock Trading API examples & templates
Use these vals as a playground to view and fork US Congress Stock Trading API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
pomdtr
lastloginHono
Script
See @pomdtr/lastlogin for more informations about the middleware Example /** @jsxImportSource npm:hono@3/jsx */
import { lastlogin } from "https://esm.town/v/pomdtr/lastloginHono";
import { verifyUserEmail } from "https://esm.town/v/pomdtr/verifyUserEmail"
import { Hono } from "npm:hono";
const app = new Hono();
const lastloginMiddleware = lastlogin({
verifyEmail: verifyUserEmail
});
// required for the auth pages to work
app.use("/auth/*", lastloginMiddleware);
// this page is public
app.get("/", async (c) => {
return c.html(
<div>
There is a secret message for you if you{" "}<a href="/secret">login</a>
</div>,
);
});
// this page requires the user to signup
app.get("/secret", lastloginMiddleware, async (c) => {
const email = c.req.header("X-User-Email");
return c.html(
<div>
I think {email} is a really silly email address, actually.
</div>,
);
});
export default app.fetch;
1
bmitchinson
Send_Errors_to_Email
HTTP
Send errors to email Get a POST request, send an email with the given subject. Used to suplement console.error , since vercel charges 20 dollars a month to send my logs elsewhere.
Wish there was a cheaper option for error specific alerting native to vercel. Further described on the val itself! https://bmitchinson-tangiblelimecockroach.web.val.run
0