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

Make tmpDir a configurable parameter #839

Merged
merged 2 commits into from
Oct 28, 2021
Merged

Conversation

erwinsmit
Copy link
Contributor

Hi Team,

I'm loving the Next.js JSS SDK so far, we are currently running it on a custom server hosted in Azure Functions. With a custom server, the API pages don't work so I had to create separate Azure Functions for these, this was fine because middlewares (EditingRenderMiddleware/EditingDataMiddleware) are easily imported and configurable. In our case, this was useful because the default dataDiskCache middleware did not work correctly.

With this simple change, we can use the default dataDiskCache middleware. Because the only issue with the implementation is that the os.tmpdir does not seem to work using Azure Functions on a consumption plan.

With this simple change, we can run this code on Azure Functions on a consumption plan.
The os.tmpdir couldn't be set using an environment variable. 

If this change is accepted I don't need to copy this whole file over In our codebase just for changing the tmpDir location.
@vercel
Copy link

vercel bot commented Oct 27, 2021

@erwinsmit is attempting to deploy a commit to the Sitecore JSS Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@ambrauer ambrauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, this looks like a great addition. Only thing I would suggest is to add a JSDoc comment for the new parameter since we generate API docs using these.

Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>
@erwinsmit
Copy link
Contributor Author

Thanks for the suggestion, this looks like a great addition. Only thing I would suggest is to add a JSDoc comment for the new parameter since we generate API docs using these.

Thanks, I've accepted the suggestion.

@erwinsmit erwinsmit requested a review from ambrauer October 28, 2021 16:41
@ambrauer ambrauer merged commit 21091b5 into Sitecore:dev Oct 28, 2021
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.

2 participants