Coder Social home page Coder Social logo

Comments (7)

lfades avatar lfades commented on April 28, 2024 1

@arturenault I opened a PR for that in the Next.js repo: vercel/next.js#35622 (it's merged)

from examples.

lfades avatar lfades commented on April 28, 2024

Hi @arturenault I hope you're doing well!

We have not decided yet about the best place to send analytics and middleware has some constraints around it, I'll come back to you in the future but for the moment I'll close the issue as analytics and logging won't be added using edge functions in our examples.

from examples.

arturenault avatar arturenault commented on April 28, 2024

Thanks, I'll look forward to that! We should probably change the docs then, at least, as it specifically mentions this as a use case for middleware.

from examples.

Noitidart avatar Noitidart commented on April 28, 2024

Aw dang, was looking for a place to do this. Looking forward to see when a solution is given for analytics like datadog.

from examples.

Noitidart avatar Noitidart commented on April 28, 2024

Does anyone else have any example of middleware where they do code before the api-route runs and then after the api-route finishes running?

from examples.

mquandalle avatar mquandalle commented on April 28, 2024

Also curious what is the recommended solution to insert a record in a database for analytics without blocking the HTTP response. I tried log drains but it's really a mess to retrieve a simple Json object.

from examples.

Noitidart avatar Noitidart commented on April 28, 2024

@mquandalle it seems we can run dd-trace as discovered here - vercel/next.js#16600 - it links to - https://jake.tl/notes/2021-04-04-nextjs-preload-hack

from examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.