How to use the @pulumi/cloud-aws.HttpEndpoint function in @pulumi/cloud-aws

To help you get started, we’ve selected a few @pulumi/cloud-aws examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pulumi / examples / cloud-ts-slack-slash-command / index.ts View on Github external
interface SlackSlashCommandResponse {
    response_type?: SlackSlashCommandResponseType;
    text: string;
    attachments?: SlackSlashCommandResponseAttachment[];
}

interface SlackSlashCommandResponseAttachment {
    text: string;
}




// Create an API endpoint
let endpoint = new cloud.HttpEndpoint("echo");

endpoint.get("/test", async (req, res) => {
    const now = Date.now();
    console.log(now);
    res.status(200).end(now.toString());
});

endpoint.post("/echo", async (req, res) => {
    const data = parseUrlEncodedBody(req.body);

    const response: SlackSlashCommandResponse = {
        response_type: "in_channel",
        text: data.text,
    };

    res.status(200).json(response);

@pulumi/cloud-aws

An implementation of the Pulumi Framework for targeting Amazon Web Services (AWS).

Apache-2.0
Latest version published 9 months ago

Package Health Score

66 / 100
Full package analysis