Deploy Serverless Functions at the Edge. Current status: Dev

Overview

Lagon logo

Deploy Serverless Functions at the Edge

lagon.app
✉️ Get email updates

Open Source • TypeScript • Web APIs
Cron triggers • Instant deployments
Interactive playground


Dashboard

About

Lagon is a free Open Source Runtime and SaaS that make it easy to deploy TypeScript and JavaScript Serverless Functions at the Edge, using V8 Isolates. You will be able to self-host it.

Warning: Lagon is still in heavy development. Do not use for production usages.

Current status:

  • Dev
  • Alpha
  • Beta
  • General Availability

Packages

  • cli CLI to deploy functions
  • prisma Prisma Client schema and migrations
  • runtime Runtime used to run functions inside V8 Isolates
  • serverless Entrypoint for all functions, using the runtime and exporting metrics
  • types Types of the runtime used when creating functions
  • website Dashboard and API
  • www Public website

Planned features

  • JavaScript Runtime based on V8 Isolates with Web APIs
  • Deploy APIs, SSR(ed) websites, Webhooks endpoints, Cron jobs...
  • CLI to deploy/remove functions and run them locally
  • Playground in the website
  • Deploy at the Edge using the SaaS, or self-host it

Roadmap

Lagon is a fairly recent project. It is still in heavy development, so expect breaking changes and buggy features.

See the roadmap on GitHub

How it works

Lagon uses V8 Isolates, which are sandboxed environments used to run plain JavaScript. That means each Function memory is isolated from each other and from the host.

They start very quickly (faster than starting a Node.js process), and we can run multiple Isolates inside a single Node.js process.

Each Function is then deployed globally in 8 locations (expect more locations soon), close to users to reduce latency.

License

GNU AGPLv3

Comments
  • ci: release

    ci: release

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

    Releases

    @lagon/[email protected]

    Patch Changes

    @lagon/[email protected]

    Patch Changes

    @lagon/[email protected]

    Patch Changes

    @lagon/[email protected]

    Patch Changes

    @lagon/[email protected]

    Patch Changes

    • #416 c3bbdb3 Thanks @QuiiBz! - Stop streaming and log errors when we have errors/timeouts/memory limits

    • #416 c3bbdb3 Thanks @QuiiBz! - Handle termination results (timeouts and memory limit) before processing streaming to avoid hanging

    opened by QuiiBz 10
  • Replace Headless.ui with Radix UI

    Replace Headless.ui with Radix UI

    About

    closes #339

    This PR replaces Headless.ui with Radix UI. Despite similar APIs, the two libraries had different strategies for the menu logic, so I did my best to stay consistent. Since Radix UI doesn't have a className render props for the active boolean, I had to use the :focus css Tailwind class, which behaves similarly.

    I also noticed the Storybook component for Menu crashed. I added a fix for that as well by installing a NextRouter emulator and using it in preview.ts and main.ts.

    opened by asharonbaltazar 8
  • atob/bto case inversion

    atob/bto case inversion

    Describe the bug atob and btoa seem to encode/decode with the wrong letter case even though the implementation in the js-runtime package works correctly.

    To Reproduce Execute the following code:

    console.log(btoa("2")); // prints "mG=="
    

    Expected behavior It should print Mg== instead.

    Information:

    • OS: Linux Mint x64
    • 0.3.4
    bug 
    opened by cyco130 8
  • fix(js-runtime): bring URL closer to the standard

    fix(js-runtime): bring URL closer to the standard

    This PR brings the URL class closer to the standard. In particular it adds the ability to reflect the changes to the href property when a part is updated: e.g. when searchParams.set is called.

    feature package/js-runtime 
    opened by cyco130 7
  • ci: release

    ci: release

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

    Releases

    @lagon/[email protected]

    Patch Changes

    @lagon/[email protected]

    Minor Changes

    • #395 18aaee0 Thanks @QuiiBz! - Redeploy the production deployment when a settings is updated

    Patch Changes

    @lagon/[email protected]

    Minor Changes

    Patch Changes

    @lagon/[email protected]

    Minor Changes

    Patch Changes

    @lagon/[email protected]

    Patch Changes

    @lagon/[email protected]

    Patch Changes

    opened by QuiiBz 6
  • Serve index.html

    Serve index.html

    Many frameworks (like Rakkas or Next.js) serve prerendered HTML files without an extension. For example the URL path /foo can refer to /foo.html or /foo/index.html but Lagon CLI serves static assets only when the URL path is an exact match which breaks static prerendering in Rakkas, and likely will have the same effect on other frameworks.

    I implemented a simple environment variable based solution in dev.rs like this:

        let serve_html = environment_variables
            .get("SERVE_HTML")
            .unwrap_or(&"".to_string())
            == "1";
        let serve_index_html = environment_variables
            .get("SERVE_INDEX_HTML")
            .unwrap_or(&"".to_string())
            == "1";
    
        if let Some(asset) = assets.iter().find(|asset| {
            *asset.0 == url
                || serve_html && *asset.0 == format!("{}.html", url)
                || serve_index_html && *asset.0 == format!("{}/index.html", url)
        }) {
    

    and it works for the dev CLI command.

    But I don't know the details of the actual deployment environments so I don't know what to do to make it work there. In any case, I feel like this should be a bundler option, not an environment variable, because it's a property of the bundled assets, not of the environment.

    Alternatively, I could duplicate the assets in the bundling phase but that seems wasteful.

    Yet another alternative could be to let JS handler worry about it and call something like Lagon.serverAsset(filename) when it deems appropriate.

    So I don't know what the exact solution should be but I can volunteer for implementing it if within my abilities.

    feature 
    opened by cyco130 6
  • fix(serverless): Axiom logger

    fix(serverless): Axiom logger

    Hey everyone, this project looks exciting! I've noticed you're using Axiom so I fixed the logger for you, hope that's alright 😊

    About

    This PR fixes a bug where only the first log event would've been sent to Axiom. Instead of grabbing the first value from the receiver, it turns the receiver into an async stream and passes it to ingest_stream for ingestion. There's more things that can be improved (e.g. ingest_stream should log errors and restart instead of panicking on error) but this is meant to be a first step.

    It also changes the way Axiom is detected to using the client constructor which will automatically configure from environment variables.

    And it renames the timestamp field name to _time so it's properly detected by Axiom.

    Please let me know if you have any questions regarding Axiom, adding support for the log crate is already on our list 😁

    opened by bahlo 5
  • Clap v4

    Clap v4

    Update from clap v3 to clap v4, which provides an easier API and changes the output of help, among others. See https://epage.github.io/blog/2022/09/clap4/

    package/cli 
    opened by QuiiBz 5
  • Use radix-ui instead of headless-ui for Menu component

    Use radix-ui instead of headless-ui for Menu component

    We're switch from @headlessui/react to radix-ui.

    The last component using headless-ui is Menu which can be replaced by the Dropdown Menu from radix-ui. Then we can uninstall @headlessui/react

    good first issue package/dashboard refactor 
    opened by QuiiBz 4
  • fix(deps): update dependency nextra-theme-docs to v2.0.0

    fix(deps): update dependency nextra-theme-docs to v2.0.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | nextra-theme-docs | 2.0.0-beta.42 -> 2.0.0 | age | adoption | passing | confidence |


    Release Notes

    shuding/nextra

    v2.0.0

    Compare Source

    Major Changes
    Patch Changes
    • e4cfb83: addPage no longer need accept frontMatter
    • 94ef0b3: improve 2.0 docs
    • 8101efe: fix(nextra): use rehype-mdx-title to determine page title
    • 6644bd5: pass unstable_flexsearch
    • cef5546: allow headings contain links
    • 2217f9c: fix Warning: Prophrefdid not match. Server: "#" Client: ...
    • e6771ca: fix edit on github button for cases when filename named as index
    • 2217f9c: fix next export command
    • fdb2f57: update docs to use next.js 13
    • 803553c: use findPagesDir from next/dist/lib/find-pages-dir
    • 568282e: fix broken build SyntaxError: Unexpected token '}'
    • a0398e0: fix: avoid mutating nextConfig
    • e6771ca: fix ReferenceError when trying to access __nextra_pageOpts__ inside MDX file
    • 59e18b0: make nextra/nextra-theme-docs/nextra-theme-blog be compatible with next 13
    • 488f737: fix client console error - Text content does not match server-rendered HTML
    • fc8cca0: add <InformationCircleIcon /> icon, improve <Callout /> default emojis
    • fe2b714: upgrade to react 18
    • 02bc6fc: use next/future/image if next>=12.3.0
    • e4cfb83: define page title in sidebar from frontMatter.title if page is not specified in _meta.json
    • 1ee3c92: reuse table styles from docs in blog
    • f569d90: missing nx- class prefixes in blog fix callout padding in docs
    • b1d7361: improve docs for 2.0
    • 8dab966: fix invisible copy button in code blocks
    • 6f987e9: fix: print shallow warning only once
    • 4825365: add @types/github-slugger instead of manually declaring type
    • f7856a1: change default options for compileMdx, set jsx: false and outputFormat: 'function-body' by default
    • cc1379c: fix Hydration failed because the initial UI... while modifying meta.json on dev env and react 18
    • 66712f0: polish docs
    • e6771ca: [Blog/Docs] Add copy to clipboard button for code-blocks. Add NextraConfig.unstable_defaultShowCopyCode option to show button by default, add copy and copy=false options for code-blocks
    • 96ed5c2: [nextra/nextra-theme-docs]: support both experimental.newNextLinkBehavior - true and false
    • b365bb0: fix TypeError: Cannot read properties of undefined (reading 'data')
    • 580c433: add nx- to all tailwind classes for style isolation
    • c3e6227: add overflow-x-scroll for tables
    • 1c3fedb: add missing nx- prefixes to table/th/tr elements
    • d7e7f5b: do not add placeholder="blur" on .svg static images
    • 78f1519: chore: Add strict-peer-dependencies=false
    • 97e6141: fix(nextra/docs): fallback search to en-US instead default
    • a0e5847: Rename some docs theme configurations
    • 74a3398: update docs for 2.0
    • 93d028b: use title package in nextra to determine sidebar title based on pagename
    • bd2cefa: Fix css classes with eslint-plugin-tailwindcss
    • ff8967c: add Toggle Word Wrap button for code-blocks (only for mobile)
    • 009bf6a: Fix release workflow.
    • e6771ca: rename meta.json to _meta.json
    • ff8967c: fix missing Copy Code button in code-blocks without language
    • 4a7cc10: feat(nextra): allow define custom languages for shiki with mdxOptions.rehypePrettyCodeOptions option
    • a2bc427: compile context.ts, ssg.ts and locales.ts to esm
    • 64ae4b5: add nextraConfig.unstable_readingTime option for blog theme
    • a9523c9: fix nextra on webcontainers
    • 383b869: Add Changesets and setup pre-release and release CI.
    • 6dc4dee: fix Unhandled Runtime Error: No content found for <route>
    • d7f2bbc: adjust docs theme; rename options
    • 256154a: use "next/future/image" if "experimental.images.allowFutureImage": true is set in next config
    • a9414be: always use next/image, since in next 12.3.2 next/future/image was renamed to next/image
    • 512953f: chore: remove redundant check for MARKDOWN_EXTENSION_REGEX.test(filename) in loader
    • c8605d6: feat: New layout implementation
    • e6771ca: better loader types, add MetaJsonFile, MdxFile, Folder types
    • 4157b71: set lower build target and share code highlight theme through nextra
    • a1c1e4e: Update docs
    • 1942a2e: chore: Fix build script
    • 699d131: feat(nextra/docs/blog): allow import .md/.mdx as well
    • 044721d: chore: Update turbo filters
    • 256154a: replace images with <NextImage /> even when url not relative but that starts from / (public directory)
    • c751458: fix(nextra): ignore in loader files from pages/api folder
    • e573175: Fix release CI
    • 21009c7: better focus ui, use ring color as theme hue color
    • 0f4795f: chore(nextra/blog/docs): provide types for PageOpts in loader
    • 71528f1: show copy code button only on hover of container
    • 03e90d8: refresh build system with tsup and fix nextra type
    • e6771ca: rename PageOpts.meta to PageOpts.frontMatter
    • 37b4445: fix react-dom peer dependency version
    • 094fdec: sort defaultMeta by frontMatter.date, if missing by frontMatter.title and after by capitalized page name
    • e6771ca: move withLayout logic directly in nextra loader
    • efd95ec: fix(nextra): allow to contain dots in page filenames
    • 094fdec: capitalize sidebar's folders names if item is missing in _meta.json
    • e35bbf7: chore: rename module to mod to avoid confusing with global module object

    v2.0.0-beta.45

    Compare Source

    Patch Changes

    v2.0.0-beta.44

    Compare Source

    Patch Changes

    v2.0.0-beta.43

    Compare Source

    Patch Changes
    • 59e18b0: make nextra/nextra-theme-docs/nextra-theme-blog be compatible with next 13

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 4
  • Headers API doesn't ignore case

    Headers API doesn't ignore case

    Describe the bug Headers API should ignore letter cases but it doesn't. It causes many failures in Rakkas's integration tests.

    To Reproduce Run the following snippet:

    const headers = new Headers();
    headers.append("X-Test", "1234");
    console.log("HEADERS", Object.fromEntries(headers.entries()));
    console.log(headers.get("X-Test")); // Prints 1234
    console.log(headers.get("x-test")); // Prints undefined
    

    Expected behavior I expect headers.get("x-test") to be equal to headers.get("X-Test").

    Information:

    • OS: Linux Mint
    • Browser: Doesn't apply
    • Version: 0.3.3
    bug 
    opened by cyco130 4
  • refactor: move Rust crates to a `crates` folder

    refactor: move Rust crates to a `crates` folder

    About

    Move Rust packages (crates) to a crates folder. Rust crates are now in this crate folder, and JS packages are in the packages folder.

    Also split runtime and serverless into smaller, scoped crates, and clean dependencies features.

    package/runtime package/cli refactor package/serverless 
    opened by QuiiBz 1
  • chore(deps): update pnpm to v7.20.0

    chore(deps): update pnpm to v7.20.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | pnpm (source) | 7.19.0 -> 7.20.0 | age | adoption | passing | confidence |


    Release Notes

    pnpm/pnpm

    v7.20.0

    Compare Source

    Minor Changes
    • pnpm gets its own implementation of the following commands:

      • pnpm config get
      • pnpm config set
      • pnpm config delete
      • pnpm config list

      In previous versions these commands were passing through to npm CLI.

      PR: #​5829 Related issue: #​5621

    • Add show alias to pnpm view #​5835.

    • pnpm reads settings from its own global configuration file at $XDG_CONFIG_HOME/pnpm/rc #​5829.

    • Add the 'description'-field to the licenses output #​5836.

    Patch Changes
    • pnpm rebuild should not fail if node_modules was created by pnpm version 7.18 or older #​5815.
    • pnpm env should print help.
    • Run the prepublish scripts of packages installed from Git #​5826.
    • pnpm rebuild should print a better error message when a hoisted dependency is not found #​5815.
    Our Gold Sponsors
    Our Silver Sponsors

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    dependency 
    opened by renovate[bot] 1
  • Fix `URL` implementation

    Fix `URL` implementation

    The current URL implementation is fairly simple and isn't very compliant with the spec:

    cd packages/wpt-runner && cargo run -- ../../tools/wpt/url/
    ...
    449 tests, 38 passed, 410 failed
     -> 8% conformance
    

    Most of the failing tests are located in urlencoded-parser.any.js (102 tests, 90 fails) and url-setters-stripping.any.js (260 tests, 260 fails)

    bug good first issue package/js-runtime 
    opened by QuiiBz 0
  • `CompressionStream` & `DecompressionStream` APIs

    `CompressionStream` & `DecompressionStream` APIs

    We have support for streaming APIs (ReadableStream, WritableStream, ...) thanks to web-stream-polyfill, but not for CompressionStream & DecompressionStream. Can we use an existing polyfill?

    https://wicg.github.io/compression/#compression-stream https://wicg.github.io/compression/#decompression-stream

    feature good first issue package/js-runtime 
    opened by QuiiBz 0
Releases(@lagon/[email protected])
Owner
Lagon
Deploy Serverless Functions at the Edge
Lagon
This is a demo of updating a map to show air quality data for the user’s current location using Next.js Advanced Middleware, powered by Netlify Edge Functions.

Show Local Air Quality Based on the User's Location Use AQI data to show the air quality near the current user. This is built using Next.js Advanced M

Jason Lengstorf 8 Nov 4, 2022
AWS Lambda & Serverless - Developer Guide with Hands-on Labs. Develop thousands line of aws lambda functions interact to aws serverless services with real-world hands-on labs

AWS Lambda & Serverless - Developer Guide with Hands-on Labs UDEMY COURSE WITH DISCOUNTED - Step by Step Development of this Repository -> https://www

awsrun 35 Dec 17, 2022
Sample code for resizing Images with Lambda@Edge using the Custom Origin. You can deploy using AWS CDK.

Resizing Images with Lambda@Edge using the Custom Origin You can resize the images and convert the image format by query parameters. This Lambda@Edge

AWS Samples 16 Dec 11, 2022
Learn Web 2.0 and Web 3.0 Development using Next.js, Typescript, AWS CDK, AWS Serverless, Ethereum and AWS Aurora Serverless

Learn Web 2.0 Cloud and Web 3.0 Development in Baby Steps In this course repo we will learn Web 2.0 cloud development using the latest state of the ar

Panacloud Multi-Cloud Internet-Scale Modern Global Apps 89 Jan 3, 2023
A Serverless GraphQL Sample project using Apollo and Serverless Framework with TypeScript and Webpack.

Serverless GraphQL Boilerplate This is a base project with a structure that includes Serverless Framework, Apollo, TypeScript and Webpack. It can be d

Ravi Souza 5 Aug 23, 2022
A serverless AWS expense tracker API. AWS Lambda functions, API gateway, and Dynamodb are among the ingredients.

AWS-Serverless-API A serverless AWS expense tracker API. AWS Lambda functions API gateway Dynamodb Endpoints Create a new expense: Method: POST Body f

Ondiek Elijah Ochieng 1 Jul 16, 2022
Cardinal generator encompasses serverless functions and smart contracts for rendering generative NFTs

Cardinal Generator An open protocol for generative NFTs. Background Cardinal generator encompasses serverless functions and smart contracts for render

Cardinal 31 Dec 6, 2022
Typescript/JavaScript serverless cloud functions for PocketBase

TS/JS Cloud Functions for PocketBase Write all your PocketBase server-side logic in TS/JS PBScript allows you to write PocketBase server-side function

Ben Allfree 12 Oct 28, 2022
Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes Introduction Salesforce Functions lets you use the Salesforce Platform for building event-driven, elastically scalable apps and expe

Trailhead Apps 172 Dec 29, 2022
A tool to check for response status codes with ease

About Archer Archer is an cross-platform tool developed using Nodejs which focuses on the reconnaissance phase of a penetration test. Got a bunch of l

Umair 14 Oct 19, 2022
Website that keeps monitoring status of WAX account and TLM balance from alienworlds

✔️ Server is now live! [21-5-2021 10:30 GMT+7] ?? Updates on Server ‼️ Bandwidth limit reaches on morning of 21 May 2021 (+7) I want to thank you to e

Patiphol Pussawong 21 Nov 24, 2022
A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch screens with a resolution of 1024x600 connected to a Raspberry Pi.

EDStatusPanel A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch scr

marcus-s 24 Oct 4, 2022
fardin 8 Oct 18, 2022
This OctoPrint plugin allows to check the Raspberry GPIO status.

GPIO Status This OctoPrint plugin allows to check the GPIO status by the web interface, without the need to connect via SSH. It also permits knowing s

Daniele Borgo 6 Mar 17, 2022
STATUS system is made using aoi.js aoi.js

STATUS system is made using aoi.js aoi.js

null 5 Mar 19, 2022
This simple extension can automatically load NBN availability information for properties on realestate.com.au & domain.com.au including technology type, maximum line speed, and co-existance status if available.

NBN Availability Check Chrome Extension This simple extension can automatically load NBN availability information for properties on realestate.com.au

Luke Prior 17 Aug 17, 2022
A modern uptime monitoring tool & status page based on Supabase.

StatusBase (Supabase) Uptime monitoring tool & beautiful status pages Powered by Supabase! Free • Open Source • Notification View Demo · Report Bug ·

StatusBase 20 Dec 3, 2022
🍕 API for HTTP status code pizzas

?? Status Pizza ⚙️ How do I use it? Standard To request a captioned status code image, simply format the request as shown below: https://status.pizza/

Peter Wetherall 22 Dec 23, 2022