ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Using Zeit for Serverless

    IT Discussion
    2
    7
    314
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stacksofplatesS
      stacksofplates
      last edited by stacksofplates

      Kelsey Hightower mentioned Zeit last year and I've been meaning to look into it. It's a pretty awesome serverless platform.

      I didn't use their now client, I just added a repo to Zeit and it manages the build and deployment for me.

      Here's a link to the repo: https://gitlab.com/hooksie1/zeit-test

      This was written in Go. Using Go you just need an exported Function and take the http.responseWriter and the http.Request. Then do you work on the payload and return the info.

      Here's the URL for the endpoint: https://goniq.hooks.technology/api/test

      You can test it by giving it a list of strings and it will return only the unique strings. For example:

      curl -X POST https://goniq.hooks.technology/api/test -d '{"list": ["testing","testing2","testing3","testing2", "mangolassi", "mangolassi"]}'
      

      It will return this data for you:

      ["testing","testing2","testing3","mangolassi"]
      
      1 Reply Last reply Reply Quote 1
      • stacksofplatesS
        stacksofplates
        last edited by

        To fully have this running it took around 15-20 minutes. Most of that was me being an idiot. The account set up was quick, I just made a repo and then took too long to write some simple code. I pushed it up and it built and deployed for me.

        1 Reply Last reply Reply Quote 0
        • stacksofplatesS
          stacksofplates
          last edited by

          You can include a package.json to specify build parameters. But I just had it use the defaults.

          1 Reply Last reply Reply Quote 0
          • jmooreJ
            jmoore
            last edited by

            Oh is this another static website service?

            stacksofplatesS 1 Reply Last reply Reply Quote 0
            • stacksofplatesS
              stacksofplates @jmoore
              last edited by

              @jmoore said in Using Zeit for Serverless:

              Oh is this another static website service?

              No this is a serverless platform. Like AWS Lambda, GCP Cloud Functions, Azure Functions, etc.

              1 Reply Last reply Reply Quote 0
              • stacksofplatesS
                stacksofplates
                last edited by

                I just changed the URL to reflect the subdomain I created.

                1 Reply Last reply Reply Quote 0
                • jmooreJ
                  jmoore
                  last edited by

                  Oh I see. Will have to check that out too then. Thanks!

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post