Custom static folder?
See original GitHub issueCan Next be configured to use a custom folder for static files, rather than /static
? (e.g. /client/static
)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8 (4 by maintainers)
Top Results From Across the Web
More than one static path in local Flask instance
I have been using following approach: # Custom static data @app.route('/cdn/<path:filename>') def custom_static(filename): return ...
Read more >Serving static files in Express
To serve static files such as images, CSS files, and JavaScript files, ... The root argument specifies the root directory from which to...
Read more >How to add static folder to custom sections - Creatio Community
Hi Team! Can you help us on how to add static folders to: 1. custom section? 2. Creatio OOTB section, where the static...
Read more >How Do You Serve Static Files in Flask? - Sentry
Flask automatically creates a static view that serves static files from a folder named static in your application's directory. You can also use ......
Read more >Basic Features: Static File Serving - Next.js
Next.js allows you to serve static files, like images, in the public directory. You can learn how it works here.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey guys,
This is really a must-have feature. In my particular case,I have tons of dynamic urls which come from API and which are absolute. So, now the only possible way of solving this issue is playing with 301 redirects which is not reliable and much more time consuming. I bet I’m not the only one who needs an ability to alternate this path.
app.serveStatic()
includesthis.isServeableUrl()
check:https://github.com/zeit/next.js/blob/e9242705a3c75fa480250ef623b926b6140b1bf5/server/index.js#L396-L410
This means that serving any static file from outside next.js dir will result 404. In order to avoid that in some special case, this raw version of
serveStatic
can be used:e.g.: