You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Transfer the values generated by compile-time to runtime. #102
After #120, this feature becomes available on the cloud platform. However, it's not yet supported in the simulation environment. A redesign of simulator is necessary to accommodate for simulation needs.
This is an example that leverages this feature, identical to the app-with-prop-access located in the testapps.
import{Router,Tester,HttpRequest,HttpResponse}from"@plutolang/pluto";constrouter=newRouter("router");router.get("/echo",async(req: HttpRequest): Promise<HttpResponse>=>{constmessage=req.query["message"]??"Hello, Pluto!";return{statusCode: 200,body: message,};});consttester=newTester("e2e");tester.it("test echo",async()=>{// Verify the correctness of business logic.constres=awaitfetch(router.url+"/echo?message=Hello%20Pluto!");constbody=awaitres.text();if(res.status!==200){thrownewError(`Unexpected status code: ${res.status}`);}if(body!=="Hello Pluto!"){thrownewError(`Unexpected body: ${body}`);}});
Activity
jianzs commentedon Jan 10, 2024
After #120, this feature becomes available on the cloud platform. However, it's not yet supported in the simulation environment. A redesign of simulator is necessary to accommodate for simulation needs.
This is an example that leverages this feature, identical to the
app-with-prop-accesslocated in thetestapps.