my-blogget-old-posts.ts25 matches
19export const oldPosts: BlogPost[] = [
20{
21"title": "Solving the internal / external API riddle",
22"slug": "api-conundrum",
23"link": "/blog/api-conundrum",
24"description": "Figuring out how to provide an API that's usable by everyone and fast for us to iterate on",
25"pubDate": "Thu, 27 Mar 2025 00:00:00 GMT",
26"author": "Tom MacWright",
27},
28{
29"title": "API Tokens Scopes",
30"slug": "api-token-scopes",
31"link": "/blog/api-token-scopes",
32"description": "Improving security with granular control over permissions",
33"pubDate": "Fri, 01 Nov 2024 00:00:00 GMT",
59},
60{
61"title": "Expanding the Vals API - RFC",
62"slug": "expanding-the-vals-api-rfc",
63"link": "/blog/expanding-the-vals-api-rfc",
64"description": "Our REST API lets you do a lot - and soon it will enable more",
65"pubDate": "Fri, 30 Jun 2023 00:00:00 GMT",
66"author": "AndrΓ© Terron",
133},
134{
135"title": "The perks of a good OpenAPI spec",
136"slug": "openapi",
137"link": "/blog/openapi",
138"description": "Taking advantage of our typed REST API to build a platform around\nVal Town.",
139"pubDate": "Thu, 25 Jul 2024 00:00:00 GMT",
140"author": "Tom MacWright",
262},
263{
264"title": "The API we forgot to name",
265"slug": "the-api-we-forgot-to-name",
266"link": "/blog/the-api-we-forgot-to-name",
267"description": "An API that takes a Request and returns a Response - what was that, again?",
268"pubDate": "Thu, 19 Oct 2023 00:00:00 GMT",
269"author": "Steve Krouse",
286},
287{
288"title": "Deprecating the Run API",
289"slug": "deprecating-the-run-api",
290"link": "/blog/deprecating-the-run-api",
291"description": "Not every function should be an API",
292"pubDate": "Wed, 07 Feb 2024 00:00:00 GMT",
293"author": "AndrΓ© Terron",
321"slug": "val-town-newsletter-1",
322"link": "/blog/val-town-newsletter-1",
323"description": "Programmatic notifications, Hacker News API, and more.",
324"pubDate": "Wed, 04 Jan 2023 00:00:00 GMT",
325"author": "Steve Krouse",
450"slug": "val-town-newsletter-22",
451"link": "/blog/val-town-newsletter-22",
452"description": "Townie upgrades, Scoped API permissions, Fal partnership",
453"pubDate": "Mon, 02 Dec 2024 00:00:00 GMT",
454"author": "Steve Krouse",
my-blog2025-04-23-upgrading.md9 matches
8Today, weβre unifying our two primitives β *vals* and *projects* β into a single primitive: the **val**, with the best features of both.
910Historically, vals have been simple and lightweight, but limited to a single file. This upgrade will preserve the elegant spirit of our platform while supporting more complex code and collaborative workflows. This upgrade will help you create bigger things on Val Town β APIs, internal tools, fullstack apps, blogs ([like this one](https://www.val.town/x/valdottown/blog)), and much more β without sacrificing the simplicity you've always loved about vals.
1112*Legacy vals* will temporarily become *projects* during this migration. Post-migration, the concept of *projects* will disappear entirely β leaving only upgraded *vals*. In short: *legacy vals* β *projects* β *vals*.
16For most users, no upgrade action is required. Weβll auto-migrate your vals next week. All existing HTTP endpoints, crons, email handlers, and custom domains will be preserved.
1718For those with mission-critical vals or who use our API to edit or create vals, you can start upgrading your legacy vals today and integrating with our updated API.
1920- **April 23, 2025** β Announcement of changes & API deprecations.
21- **April 30, 2025** β All remaining *legacy vals* auto-upgraded. Deprecated API routes become read-only.
22- **May 1, 2025** β The term *projects* will no longer exist β everything will simply be a *val*.
2335[See more details in our docs.](https://docs.val.town/upgrading/legacy-vals)
3637## API Changes
3839Today, we're introducing the following API routes:
4041```bash
73```
7475View our [updated API reference here](https://docs.val.town/openapi).
7677All `v1/vals` API routes become read-only on **April 30, 2025**. If you rely on *writing* to those routes, please upgrade to our new `v2/vals` API. All deprecated API routes will continue serving historical legacy val data.
7879### SDK changes
85861. Upgrade your mission-critical vals early.
872. Update your Val Town API & SDK usage to `/v2` routes.
883. All remaining legacy vals migrate on **April 30, 2025**.
894. Migration completes on **May 1, 2025**.
83We didn't. We left them where they are, and proxy to them.
8485Writing a proxy in Val Town (or any functions platform with the ['fetch handler' interface](https://blog.val.town/blog/the-api-we-forgot-to-name/)) is a delight:
8687```ts
e-comm-testCartItem.jsx2 matches
4import { useState } from "react";
5import { Button, Card, Form } from "react-bootstrap";
6import { api } from "../api";
78const CartItem = ({ item, onUpdate }) => {
11const handleRemove = async () => {
12try {
13await api.delete(`/customer/cart/remove/${item.product._id}`);
14onUpdate();
15} catch (error) {
untitled-1573index.ts1 match
2021// Get weather data endpoint
22app.get("/api/weather", async (c) => {
23try {
24const latitude = c.req.query("latitude");
internshipApp.tsx3 matches
33}
3435// Otherwise fetch from API
36const response = await fetch("/api/tools");
37if (!response.ok) {
38throw new Error("Failed to fetch tools");
63setLoading(true);
64try {
65const response = await fetch("/api/search", {
66method: "POST",
67headers: {
internshipapi.ts6 matches
4import { AITool, SearchRequest, ToolCategory } from "../../shared/types";
56const api = new Hono();
7const openai = new OpenAI();
89// Get all tools
10api.get("/tools", async (c) => {
11try {
12const tools = await getAllTools();
1920// Get tool by ID
21api.get("/tools/:id", async (c) => {
22try {
23const id = parseInt(c.req.param("id"));
3637// Get tools by category
38api.get("/tools/category/:category", async (c) => {
39try {
40const category = c.req.param("category") as ToolCategory;
4849// Search tools with AI enhancement
50api.post("/search", async (c) => {
51try {
52const body = await c.req.json() as SearchRequest;
126});
127128export default api;
hotelsListREADME.md3 matches
5## Structure
67- `types.ts` - TypeScript interfaces for hotel data and API requests/responses
89## Types
1011- `Hotel` - Represents a hotel with its details
12- `HotelSearchResponse` - API response format for hotel searches
13- `HotelSearchRequest` - API request format for hotel searches
internshipREADME.md2 matches
21β β βββ queries.ts # Database query functions
22β βββ routes/
23β β βββ api.ts # API routes for search and recommendations
24β βββ index.ts # Main backend entry point
25βββ frontend/
4546- Frontend: React with Tailwind CSS
47- Backend: Hono API framework
48- AI: OpenAI for query understanding and tool recommendations
49- Database: SQLite for tool information storage
hotelsListREADME.md5 matches
1# Hotel Finder Backend
23This directory contains the backend API for the Hotel Finder application.
45## Structure
67- `index.ts` - Main entry point for the HTTP API
8- `services/hotelService.ts` - Service for fetching hotel data
910## API Endpoints
1112### GET /api/hotels
1314Fetches hotels by zip code.
42## Notes
4344- The current implementation uses mock data. In a production environment, this would be replaced with calls to a real hotel API.
45- Hotels are sorted by weekly price (lowest to highest).