https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • h

    HardAtWork

    04/27/2023, 8:42 PM
    Doesn’t Deno just ignore types once it is running?
  • s

    Skye

    04/27/2023, 8:42 PM
    Honestly no idea
  • h

    HardAtWork

    04/27/2023, 8:43 PM
    You know any examples of langs that actually do that?
  • s

    Skye

    04/27/2023, 8:43 PM
    Go does
  • s

    Skye

    04/27/2023, 8:43 PM
    Rust probably has something for it
  • h

    HardAtWork

    04/27/2023, 8:44 PM
    I think Rust does compile time checks that you handle parsing correctly
  • h

    HardAtWork

    04/27/2023, 8:44 PM
    But it doesn’t actually do anything at runtime
  • h

    HardAtWork

    04/27/2023, 8:44 PM
    Or at least, as far as I understand
  • s

    Skye

    04/27/2023, 8:44 PM
    I don't use it so I wouldn't know
  • s

    Skye

    04/27/2023, 8:45 PM
    I'm sure there's something for it in all of those kinds of languages anyway 😅
  • t

    Tom Sherman

    04/27/2023, 8:46 PM
    Rust workers 😅
  • t

    Tom Sherman

    04/27/2023, 8:47 PM
    It does do stuff at runtime, you can't get a value of a certain type without that thing being the certain type
  • t

    Tom Sherman

    04/27/2023, 8:47 PM
    The types need to be correct for the memory layout to be correct
  • f

    frankjonen

    04/27/2023, 10:14 PM
    Good, since the plug-in doesn't actually work. It should be removed from the repo as it only burns people's time. I did everything by the book from scratch. Even transferred the domain over for maximum accuracy. Plug-in is completely without function.
  • f

    frankjonen

    04/27/2023, 10:28 PM
    Doesn't work either btw. Probably because it's almost a year old information and something changed meanwhile.
  • c

    Chaika

    04/27/2023, 10:33 PM
    API should be the exact same. What specific error are you getting? Make sure you're not trying Quick Edit or local dev, neither will work with the mailchannels api
  • f

    frankjonen

    04/27/2023, 10:35 PM
    I don't even know what Quick Edit is or where to find it. I'm testing on a live public site. I'm again not getting any errors, it just doesn't work. When I pull up the
    /api/send
    for the script, it renders a CSS-less version of index.html instead of the JS.
  • c

    Chaika

    04/27/2023, 10:38 PM
    You're trying to use the mailchannels API directly, and wrote your own function to do so? Sounds like the function isn't being picked up if that's the case. The functions folder needs to be in your root directory
  • c

    Chaika

    04/27/2023, 10:39 PM
    I would check the build details, there's a functions tab
  • f

    frankjonen

    04/27/2023, 10:46 PM
    I used their function and added my email addresses. I'll try to find the functions tab somewhere.
  • c

    Chaika

    04/27/2023, 10:47 PM
    You mean you used the plugin?
  • c

    Chaika

    04/27/2023, 10:47 PM
    If you're talking about the code snippet from mailchannels, that's a worker, not a function
  • f

    frankjonen

    04/27/2023, 10:49 PM
    Is there any straightforward, documented, non-cryptic way to do this?
  • f

    frankjonen

    04/27/2023, 10:51 PM
    I went from the .ts plugin to the code you linked me from their page. In the functions tab I see a point on
    api/submit
    despite the script being
    api/send.js
    No idea what that's about.
  • z

    zszszsz

    04/28/2023, 12:42 AM
    Shouldn't you just read its api and do it your own ? That's really no more than 10 lines of code
  • c

    Chaika

    04/28/2023, 12:45 AM
    Yea that code wouldn't work with functions without some changes. Functions run like workers but with some extra stuff on top like file based routing rather then listening for all requests like workers do. The plugin is probably your best bet for a straight forward way to do it, other then that, just modifying the code you had linked way above to use the mailchannels fetch
  • f

    frankjonen

    04/28/2023, 12:48 AM
    I'll try with the functions once more. The plugin doesn't work, you can try it yourself. Doesn't do anything. Like it's missing some hooks.
  • c

    Chaika

    04/28/2023, 12:51 AM
    did you add the middleware?
  • c

    Chaika

    04/28/2023, 1:02 AM
    I spun up a new pages project, added the middleware and html, and it submits without issue and I get an email. Should probably move to #789155108529111069 though
  • f

    frankjonen

    04/28/2023, 1:11 AM
    the
    _middleware.ts
    script? Yep. Trying an adaptation of the fetch script now. —— No joy btw. Getting a 405.
1...242424252426...2509Latest