We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently serve-json supports 4 formats of data files: edn json cirru cson.
serve-json
edn
json
cirru
cson
.cirru
Cirru is my favorite one. It looks clean and has 1016 chars(including spaces).
{} :port 7800 :routes $ [] {} :path |home :get $ {} (:type :file) (:file |home.json) {} :path |plants/:plant-id :get $ {} (:type :file) (:file |plant-default.json) :post $ {} (:type :file) (:file |ok.json) :next $ [] {} :path |overview :get $ {} (:type :file) (:file |overview.json) {} :path |materials/:material-id :get $ {} (:type :file) (:file |materials.json) :next $ [] {} :path |events :get $ {} (:type :file) (:file |events.json) :delete $ {} (:code 202) (:type :file) (:file |ok.json) {} :path |notifications/me :next $ [] {} :path |messages :get $ {} (:type :file) (:file |messages.json) {} :path |messages:latestUnread :get $ {} (:type :file) (:file |unread-mesages.json) {} :path |user/settings/preferences :put $ {} (:type :file) (:file |ok.json)
EDN is the default data used in ClojureScript. It has 1053 chars and looks really compact.
But people feel bored in getting colons aligned to the previous ones.
{:port 7800, :routes [{:path "home", :get {:type :file, :file "home.json"}} {:path "plants/:plant-id", :get {:type :file, :file "plant-default.json"}, :post {:type :file, :file "ok.json"}, :next [{:path "overview", :get {:type :file, :file "overview.json"}} {:path "materials/:material-id", :get {:type :file, :file "materials.json"}, :next [{:path "events", :get {:type :file, :file "events.json"}, :delete {:code 202, :type :file, :file "ok.json"}}]}]} {:path "notifications/me", :next [{:path "messages", :get {:type :file, :file "messages.json"}} {:path "messages:latestUnread", :get {:type :file, :file "unread-mesages.json"}}]} {:path "user/settings/preferences", :put {:type :file, :file "ok.json"}}]}
So there another EDN(Flavored EDN) indented like JSON, it's also neat, but containing more lines since { and } are used:
{
}
{ :port 7800 :routes [ { :path "home" :get {:type :file, :file "home.json"} } { :path "plants/:plant-id" :get {:type :file, :file "plant-default.json"} :post {:type :file, :file "ok.json"} :next [ { :path "overview" :get {:type :file, :file "overview.json"} } { :path "materials/:material-id" :get {:type :file, :file "materials.json"} :next [ { :path "events" :get {:type :file, :file "events.json"} :delete {:code 202, :type :file, :file "ok.json"} } ] } ] } { :path "notifications/me" :next [ { :path "messages" :get {:type :file, :file "messages.json"} } { :path "messages:latestUnread" :get {:type :file, :file "unread-mesages.json"} } ] } { :path "user/settings/preferences" :put {:type :file, :file "ok.json"} } ] }
Then comes JSON, it's like Flavored EDN but with more quotes and commas, not good for writing:
{ "port": 7800, "routes": [ { "path": "home", "get": { "type": "file", "file": "home.json" } }, { "path": "plants/:plant-id", "get": { "type": "file", "file": "plant-default.json" }, "post": { "type": "file", "file": "ok.json" }, "next": [ { "path": "overview", "get": { "type": "file", "file": "overview.json" } }, { "path": "materials/:material-id", "get": { "type": "file", "file": "materials.json" }, "next": [ { "path": "events", "get": { "type": "file", "file": "events.json" }, "delete": { "code": 202, "type": "file", "file": "ok.json" } } ] } ] }, { "path": "notifications/me", "next": [ { "path": "messages", "get": { "type": "file", "file": "messages.json" } }, { "path": "messages:latestUnread", "get": { "type": "file", "file": "unread-mesages.json" } } ] }, { "path": "user/settings/preferences", "put": { "type": "file", "file": "ok.json" } } ] }
CSON is much more neat than any of above. It's in 783 chars, really sharp.
port: 7800 routes: [ path: 'home' get: type: 'file', file: 'home.json' , path: 'plants/:plant-id' get: type: 'file' file: 'plant-default.json' post: type: 'file', file: 'ok.json' next: [ path: 'overview' get: type: 'file', file: 'overview.json' , path: 'materials/:material-id' get: type: 'file', file: 'materials.json' next: [ path: 'events' get: type: 'file', file: 'events.json' delete: code: 202, type: 'file', file: 'ok.json' ] ] , path: 'notifications/me' next: [ path: 'messages' get: type: 'file', file: 'messages.json' , path: 'messages:latestUnread' get: type: 'file', file: 'unread-mesages.json' ] , path: 'user/settings/preferences' put: type: 'file', file: 'ok.json' ]
Personally I like Cirru since it contains no long [ ... ] or { ... }, which is quite fluent for handwriting, no need to balance brackets.
[ ... ]
{ ... }
Flavored EDN would be just fine for people familiar with JSON but want fewer chars. CSON would be great for indentation enthusiasts.
The text was updated successfully, but these errors were encountered:
Who's the boss! 518 chars:
--- port: 7800 routes: - path: home get: type: file file: home.json - path: plants/:plant-id get: type: file file: plant-default.json post: type: file file: ok.json next: - path: overview get: type: file file: overview.json - path: materials/:material-id get: type: file file: materials.json next: - path: events get: type: file file: events.json delete: code: 202 type: file file: ok.json
Just added support.
Sorry, something went wrong.
No branches or pull requests
Currently
serve-json
supports 4 formats of data files:edn
json
cirru
cson
..cirru
- Cirru EDNCirru is my favorite one. It looks clean and has 1016 chars(including spaces).
EDN is the default data used in ClojureScript. It has 1053 chars and looks really compact.
But people feel bored in getting colons aligned to the previous ones.
So there another EDN(Flavored EDN) indented like JSON, it's also neat, but containing more lines since
{
and}
are used:Then comes JSON, it's like Flavored EDN but with more quotes and commas, not good for writing:
CSON is much more neat than any of above. It's in 783 chars, really sharp.
Personally I like Cirru since it contains no long
[ ... ]
or{ ... }
, which is quite fluent for handwriting, no need to balance brackets.Flavored EDN would be just fine for people familiar with JSON but want fewer chars. CSON would be great for indentation enthusiasts.
The text was updated successfully, but these errors were encountered: