Comments (4)
Cool! I think site.yaml
is a better place than command line.
from nue.
@tipiirai Perhaps tag this issue with a label : requires-documentation <-- or similar, and we keep it open until the documentation is updated? (after the PR is merged I mean) Since we can get that in now, and update docs later.
from nue.
Update
I've run a basic test on cloudflare and this doesnt appear to be interfering with cloudflare pages "functions".
I'd feel a lot more comfortable knowing the directory is phyiscally ignored. For now the work around would be to make sure you don't include any markdown files in the folders?
The files inside the functions directory can't be served statically, since cloudflare will try to route requests matching file paths to matching code "handlers" and expect your code to handle them as REST requests. Which will just translate to GET requests that do or do not match any script files. There wont be any handlers matching the request, and I think what happens in that case, is the requests get converted into root requests for / and the paths get ignored.
For example, what I just tested;
I have a cloudflare function code at functions/api/contact-us.js
that's hard coded to handl POST's and return json
{
"cnt":1,
"message": "hello world"
}
When you try to make a GET request to myblog.com/api/contact-us
, cloudflare returns the request as if you had made a GET request to "myblog.com".
And when you make a POST request, the cloudflare function handles the POST correctly.
For now there is a workaround, (which is to do nothing) and yes it's messy, but it's a low priority to fix? I might submit a PR to fix it shortly to avoid accidentally causing something to break. leaving it like this feels like big unexpected problem waiting to cause some unexpected pain later when we add some new functionality to fswalk or similar.
The fact that it doesnt cause a problem right now is just a happy co-incidence, and not by design.
There is a real risk that server side artifacts could accidentally be rendered out in some future enhancement and included in .dist/prod
. E.g. developer's private readme.md
notes etc. That could be quite bad for some devs.
from nue.
I thought of that, but then wondered if site.yaml should kept clean and only contain content matters, so that if you change your tech, the site.yaml shouldnt change. I think that might be a consideration for later, but for now the advantage of using site.yaml is not having to implement another settings strategy. I think that will come soon, (e.g. passing in environment variables from build server) but we can cross that bridge later.
very long way to say, I agree. I'll create a PR that looks for extra settings in site.yaml. Will need to update docs later when docs can be previewed by contributors ... as well.
from nue.
Related Issues (20)
- create error
- Update CLI help message to represent current options HOT 1
- Custom JSX/TSX components HOT 2
- Syntax error HOT 1
- Pending when creating projects with bun under Windows HOT 12
- The path of the route is expected to support regular expressions HOT 1
- component at layout.html compile error HOT 3
- When '{}' or',' in html , How to escape? HOT 1
- It can not start the server with nuekit 0.5.3, but works with nue 0.4.3 HOT 6
- auto generate manifest.json file
- a bug in the nuecli root HOT 5
- unmounted() Why is it not executed?
- Reactive values are not updated? why? HOT 3
- Page router doesn't mount components. Refresh needed to properly mount. HOT 2
- "draw_sections: true" results in nested sections HOT 5
- When iterating collections: can we render the markdown content of an item? HOT 5
- three-tiered directory structure layout HOT 1
- Add default`text` property to default `data` object available to page layouts.
- SPA demo not working when deploy on subpath of domain
- Nuemark: How to add svg inside a button HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nue.