Comments (3)
Thanks for filing the issue. It should be possible to serve json (I've done it myself), but you'd need a json template and the json header, otherwise it should work, let me know if you have issues doing that specifically what the issues are. You can render content yourself you don't have to use view.Render(), but again happy to adjust view.Render if required to fix any issues.
Re REST I should have said REST-ish if I've used that term anywhere :) It will probably never be fully REST but I'm happy to consider changes to methods etc if they have a practical application. True Rest would have two urls, no update method at all I think, and use http methods to distinguish intent. REST specifies the HTTP method, not the method name in the app, so for example I believe it is supposed to be:
- Create - POST /resources
- Update - PUT or PATCH /resources/1
- Read - GET /resources/1
- Delete - DELETE /resources/1
Historically browser and server library support for the verbs apart from GET and POST has been patchy, hence we still use POST for delete, not true rest. However, this is complete separate from the action names used to define the actions, which is entirely arbitrary (for example rails uses /edit for update). I haven't looked into browser support recently but would be open to looking at changing the urls for resources if it is fully supported in all possible clients for both html and js. Unfortunately I don't think that's the case. See this stackoverflow question for detail on this:
As far as I know it is still not part of the html standard for forms, which means we can't use it.
There are other frameworks available if you just want to serve only json in a REST style, so it might also be worth looking at them too, as the focus of fragmenta is more on serving html. I would like it to handle json though so please do file bugs on any specific problems you encounter.
from fragmenta-cms.
as you wrote, it is not rest api. It serve a html webpage. The description is incorrect.
from fragmenta-cms.
REST doesn't care what sort of resources are served, so this is nothing to do with json/html.
I'm closing this now as I don't see any constructive criticism but if you have any specific problems with serving json, do put them here. I'll probably change the comment at some point, it's not a high priority.
from fragmenta-cms.
Related Issues (20)
- can't create project - panic: runtime error: slice bounds out of range HOT 1
- any plans on building a docker image? HOT 3
- Required Go Version HOT 2
- Editing top menu HOT 1
- It needs a basic tutorial HOT 3
- fragmenta server results in "a:unable to compile assets error:open public/assets/scripts/app-9ad47a746ac7acfa883dafa4ae0db5721bcea629.min.js: The system cannot find the path specified." HOT 7
- fragmenta: command not found HOT 2
- Incorrect datetime value for MySQL database HOT 2
- Use tags for pages, and document use
- I can't pass null value to database HOT 3
- I can't pass DML SQL commands to database HOT 2
- Support database transactions HOT 2
- Proposal: Parse JSON params in mux HOT 1
- Error copying project exec "cp" HOT 1
- Error calling go get exit status 1 HOT 1
- Handle multiple domains HOT 5
- Database user is configurable but hard-coded in migrations HOT 1
- JS Error: sel is not defined HOT 2
- Runtime editable templates feature discussion HOT 1
- uploaded file management
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 fragmenta-cms.