Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Eta template engine middleware #6

Closed
wants to merge 2 commits into from

Conversation

nebrelbug
Copy link

As discussed in #5, this PR adds middleware that enables template rendering with Eta 🚀

The middleware works well, but there's one problem. Inside the middleware file, I write

declare module "https://deno.land/x/oak/mod.ts" {
  interface Context {
    render: (fileName: string, data?: object) => void
  }

  interface RouterContext {
    render: (fileName: string, data?: object) => void
  }
}

To add the .render method to the Context type (based on the view_engine middleware). However, this only works if the user is using the same version of Oak; in this case, the latest version. Any thoughts?

I'm open to any feedback or requested changes 😃

@kitsonk kitsonk self-assigned this Sep 15, 2020
@kitsonk kitsonk self-requested a review September 15, 2020 23:48
@kitsonk kitsonk removed their assignment Sep 15, 2020
@nebrelbug
Copy link
Author

I just updated the middleware to include the type declaration on the user's side -- I think in the long run this is best.

@nebrelbug nebrelbug closed this Oct 15, 2020
@nebrelbug nebrelbug reopened this Oct 15, 2020
@boehs
Copy link

boehs commented Jan 5, 2022

it would be awesome if this got merged

@nebrelbug
Copy link
Author

I am going to close this PR, since it looks like oakserver/middleware is no longer being maintained.

@nebrelbug nebrelbug closed this Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants