Contentstack Launch Test
A minimal Next.js app for testing Contentstack Launch features
Routes Reference
A running list of every route in this project, kept here so it survives each redeploy.
API Routes
/api/log-bulkWrites `count` stdout log lines (Node runtime), each padded to `sizeKb`.
e.g. /api/log-bulk?count=5&sizeKb=1&startIndex=1
/api/log-bulk-requestsFires `count` sequential HTTP calls to /api/log-bulk so each log is its own request.
e.g. /api/log-bulk-requests?count=5&sizeKb=1
/api/log-chunkEmits chunked console.log lines capped at `lineKb`, tunes JSON response to `responseKb`.
e.g. /api/log-chunk?lineKb=1&responseKb=10
/api/log-sizePrints one console.log line of roughly `size` KB.
e.g. /api/log-size?size=1024
/api/reproduce-large-logForwards a synthetic OTLP log record directly to the telemetry endpoint (bypasses stdout).
e.g. /api/reproduce-large-log?size=1100000
/api/reproduce-telemetry-kafkaWrites one raw stdout line of `size` repeated characters (no OTLP wrapper).
e.g. /api/reproduce-telemetry-kafka?size=1100000
Page Routes
/Home / landing page (this page).
/rewriteRewrite source page demo.
/rewrite/successRewrite destination page demo.
/new_rewriteAnother rewrite demo page.
/log-bulk-requestsUI wrapper that fires per-log requests to /api/log-bulk.
/cache-priming1Static cache-priming target #1 (listed in launch.json cachePriming.urls).
/cache-priming2Static cache-priming target #2 (listed in launch.json cachePriming.urls).
/cache-priming3Static cache-priming target #3 (listed in launch.json cachePriming.urls).
/cache-priming4Static cache-priming target #4 (listed in launch.json cachePriming.urls).
/cache-priming5Static cache-priming target #5 (listed in launch.json cachePriming.urls).
Cloud Functions (functions/)
/cache_priming_cloudCache-priming target that returns JSON with an explicit s-maxage; `generatedAt` stays put on a cache hit.
/helloEchoes back the request body, query and cookies.
/userReturns a name plus its short form via functions/utils.js.
Edge Functions
/edgeReturns the current server timestamp.
/edge/geoReturns geo headers (country/region/city) forwarded by the platform.
Redirects & Rewrites (launch.json)
/redirectRedirects to /redirect/success.
/new_redirectRedirects to external URL launchassignment-b6f4d9.contentstackapps.com.
/rewriteRewrites to /rewrite/success.
/rewrite1Rewrites to /new_rewrite.
Cache Priming
The paths below are listed under cache.cachePriming.urls in launch.json. Launch requests each one right after a deploy, so the edge is warm before real traffic arrives.
The pages are statically prerendered, so the first real visitor gets a cache hit instead of a cold render. The cloud function has to opt in itself: it sends s-maxage so the edge is allowed to store the response, since an uncacheable function would just re-run on every request and gain nothing from priming.
/pagePRIMED/cache-priming1pagePRIMED/cache-priming2pagePRIMED/cache-priming3pagePRIMED/cache-priming4pagePRIMED/cache-priming5pagePRIMED/cache_priming_cloudcloud functionCheck a primed response with curl -sI https://<your-domain>/cache-priming1 and look at the cache/age headers.