Mops Server package

if I create a API using mops server package with Motoko,
When I deploy that locally, Can I access it using postman? and How

server.get(“/list”, func(req : Request, res : ResponseClass) : async Response {
res.send({
status_code = 200;
headers = [(“Content-Type”, “text/plain”)];
body = Text.encodeUtf8(“Hello, world!”);
streaming_strategy = null;
cache_strategy = #default;
});
});

The route goes before the query parameter, and unfortunately, the canisterId parameter will still be present, when you run your tests.

so, if your canisterID is f3nhr-bmaaa-aaaaa-qaayq-cai, you’d probably want
http://127.0.0.1:4943/list?canisterId=f3nhr-bmaaa-aaaaa-qaayq-cai

2 Likes

It worked. Thank you so much.