🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)
🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)

🔧 Programmierung 🕛 kürzlich 9 Min Lesezeit
0

Blinks on AWS with SST

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Most projects I know that revolves around Blinks or to develop and deploy Blinks. But did you know that apart from Next.js, you can actually build Blinks on your favorite Node backend? In this article, we'll use
Dialect Blinks



Blockchain Links, or Blinks turn any .






What are Solana Actions?



.






What is SST?



Serverless Stack (SST) is a framework that makes it easy to build modern full-stack applications on your own infrastructure .




If you want to know more about how Blinks work, you can check out the installed on your machine.

  • AWS Account






  • Project Setup




    If you want to check the reference code, you can check it out !







    Configure AWS CLI



    SST uses the AWS CLI to deploy your project. Make sure you have the AWS CLI installed and configured to your AWS account as SST will deploy the resources there you can read more .



    Within links.actions, it specifies an array of actions that can be performed. In this case, we have a list of donation amounts (1, 5, 10) and a custom donation amount.



    Every action has a corresponding href that points to the API endpoint that will handle the action.



    The get function returns the metadata of the action as well as the CORS headers.



    The options function is a simple copy of the get function. It is used to handle the preflight request for CORS.






    Configure the endpoint in sst.config.ts






    CODE
    export default $config({
    app(input) {
    return {
    name: 'sst-blinks',
    removal: input?.stage === 'production' ? 'retain' : 'remove',
    home: 'aws',
    };
    },
    async run() {
    const api = new sst.aws.ApiGatewayV2('Actions');

    api.route('GET /api/donate', {
    handler: 'src/donate.get',
    });
    api.route('OPTIONS /api/donate', {
    handler: 'src/donate.options',
    });
    },
    });






    Upon initializing sst in your project, you will have a minimal config of sst.



    What we've added is in the run function where we create an API Gateway with the name Actions and add two routes:




















    Method url
    GET /api/donate
    OPTIONS /api/donate


    This means that the API will have two endpoints that will handle the GET and OPTIONS requests.






    Run the command






    CODE
    # Development mode
    npx sst dev






    SST may take a while to deploy the resources on your AWS Account, but once it is successful, it will output the URL of the API.



    https://<api-id>.execute-api.<region>.amazonaws.com/<api-endpoint>






    Test the blink



    You can check the blink by going to




    You will see a warning that the actions has not yet been registered. That is normal as Dialect requires Blinks to be registered first before using it on different websites for security purposes.







    Creating the POST donate endpoint



    Now that we have the GET and OPTIONS endpoints, let's create the POST endpoint that will handle the donation.






    CODE
    export const post: Handler = async (event: APIGatewayProxyEvent, context) => {
    const amount = event.pathParameters?.amount ?? DEFAULT_DONATION_AMOUNT_SOL.toString();

    const body = await JSON.parse(event.body || '{}');
    let account;

    try {
    account = new PublicKey(body.account);
    } catch (error) {
    return {
    statusCode: 400,
    body: 'Invalid account',
    headers: ACTIONS_CORS_HEADERS,
    };
    }

    const parsedAmount = parseFloat(amount);
    const transaction = await prepareDonateTransaction(
    new PublicKey(account),
    new PublicKey(DONATION_DESTINATION_WALLET),
    parsedAmount * LAMPORTS_PER_SOL,
    );

    const response = await createPostResponse({
    fields: {
    type: 'transaction',
    transaction: transaction,
    },
    });

    return {
    statusCode: 200,
    body: JSON.stringify(response),
    headers: ACTIONS_CORS_HEADERS,
    };
    };









    Code walkthrough




    • We first get the amount from the URL path parameters. If it is not present, we use the default donation amount (1 SOL).

    • We then parse the body of the request to get the account of the user.

    • After that, we prepare the transaction using the prepareDonateTransaction function.

    • The prepareDonateTransaction function is a custom function that prepares the transaction to send the donation to the wallet address. For further details, check the docs .






      Configure actions.json endpoint in sst.config.ts






      CODE
      async run() {
      const api = new sst.aws.ApiGatewayV2('Actions');

      api.route('GET /api/donate', {
      handler: 'src/donate.get',
      });
      api.route('OPTIONS /api/donate', {
      handler: 'src/donate.options',
      });
      api.route('POST /api/donate/{amount}', { handler: 'src/donate.post' });

      api.route('GET /actions.json', { handler: 'src/actions.get' });
      api.route('OPTIONS /actions.json', { handler: 'src/actions.options' });
      },






      Finally, our API now has five endpoints:
































      Method url
      GET /api/donate
      OPTIONS /api/donate
      POST /api/donate/{amount}
      GET /actions.json
      OPTIONS /actions.json





      Deploy to Production



      Deploying on production with SST is easy. Just run the following command:




      CODE
      npx sst deploy --stage production







      It will output a new URL that you can use to test your blink.






      Demo



      Donating 1 SOL








      Cleanup



      Removing the resources is as easy as deploying them. Just run the following command:




      CODE
      npx sst remove # to remove the resources in the development stage
      npx sst remove --stage production # to remove the resources in the production stage









      Conclusion



      And that's it! You've successfully deployed your Blinks on AWS using SST. You can now create more Blinks and deploy them on AWS with ease!



      Feel free to create a git repository and push your code to GitHub!



      If you have any questions or found any issues, feel free to comment below.

      Vollständiger Original-Bericht
      Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
      ↗ Original-Artikel auf dev.to lesen
    Wie bewertest du diesen Beitrag?
    1 Klick Feedback
    Teilen mit Netzwerk & Team:

    Community-Analysen & Experten-Meinungen 0

    Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
    Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
    Community Pulse: Relevanz-Einschätzung
    1 Klick Experten-Votum
    🔴 Akute Relevanz 0%
    🟡 In Evaluierung 0%
    🟢 Keine Auswirkung 0%
    Spannende Innovation 0%
    Verwandte Story-Cluster & Quellen (Vektor-KI)
    Port 8095 Engine
    1 Quelle
    Hackers Just Poisoned the Rust Supply Chain | Threat Wire
    1 Quelle
    Hackers Found a Way Into Humanoid Robots | Threat Wire
    1 Quelle
    Bits und so #1021 (Passwort für Laufwerk)
    Ähnliche Beiträge
    🔍 Verwandte News

    Auch interessante Nachrichten Blinks on AWS with SST

    Thematisch verwandte Begriffe: Blinks, with · 6 Treffer

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...