Public
Like
WeatherAPP
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
index.ts
https://EveVickem--32c1a2c03fae11f0ab7176b3cceeab13.web.val.run
A simple weather application that shows current temperature for any city with intelligent city name autocomplete.
- Smart City Search: Auto-complete with city suggestions as you type
- Accurate Spelling: Helps users find the correct city name and location
- Keyboard Navigation: Use arrow keys to navigate suggestions, Enter to select, Escape to close
- Display current temperature in Celsius and Fahrenheit
- Show additional weather details (humidity, wind speed, conditions)
- Clean, responsive interface with glassmorphism design
- Uses Open-Meteo API (no API key required)
backend/index.ts
- Main HTTP server with API endpointsfrontend/index.html
- Main HTML templatefrontend/index.tsx
- React frontend application with autocompletefrontend/style.css
- Custom styles including autocomplete dropdown
GET /
- Serves the main applicationGET /api/cities?q={query}
- Returns city suggestions for autocompleteGET /api/weather?city={cityName}
- Returns weather data for the specified city
- Start typing a city name in the search box
- Select from the autocomplete suggestions or continue typing
- Click "Get Weather" or press Enter
- View the current temperature and weather conditions
- Toggle between Celsius and Fahrenheit
- Shows up to 5 city suggestions as you type
- Displays city name, state/province, and country
- Keyboard navigation with arrow keys
- Click or press Enter to select a suggestion
- Automatic spelling correction and location disambiguation