FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
rozek
rozekGDI_StatusCodeService
Remix of rozek/GDI_URLParserService
Public
Like
GDI_StatusCodeService
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
Code
/
Search
main.tsx
https://rozek--79d7767226d511f0a5b3569c3dd06744.web.val.run
README.md

This val is part of a series of examples to introduce "val.town" in my computer science course at Stuttgart University of Applied Sciences.

The idea is to motivate even first-semester students not to wait but to put their ideas into practice from the very beginning and implement web apps with frontend and backend.

It contains a very simple HTTP end point which analyzes the URL path (after the val base URL) and - if the path contains a valid HTTP status code (i.e., an integer in the range 1000...599) - uses that as the status code of the request. Otherwise, it responds with status code 500 "bad request".

In order to use it, send a request similar to the following

https://rozek-gdi_statuscodeservice.web.val.run/418

Nota bene: since this val may respond with an HTTP error code, don't be surprised if you use this val from within a browser and the browser presents an error message!

The code was created using Townie - with only a few small manual corrections.

This val is licensed under the MIT License.

Migrated from folder: GDI_Examples/GDI_StatusCodeService

HTTP
  • main.tsx
    rozek--79…44.web.val.run
Code
README.md
H
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.