serving xml files

4 views
Skip to first unread message

Roberto Saccon

unread,
Mar 22, 2010, 1:15:15 PM3/22/10
to nitro-devel
while it is not problem at all to serve any type of content with any
type of content, it looks strange to me how I need to set up thing for
serving anything else than HTML, e.g. I do for serving /example which
should be be an xrds+xm file, I do:

example.js
---------------
exports.GET = function(env) {
return {
headers: {
"Content-Type": "application/xrds+xml"
},
data: {
myvar: "foo"
}
};
}

example.html
--------------------
<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)">
.......
</xrds:XRDS>

Wouldn't it be nicer if the template could be called example.xml ?
Or is there already a better way to handle this ?

George Moschovitis

unread,
Mar 22, 2010, 1:21:12 PM3/22/10
to nitro...@googlegroups.com
you should serve:

/example.xml

the default extension is .html so

/example 

is really

/example.html

if you use /example.xml

you can use the xml extension in your template.

-g.


--
You received this message because you are subscribed to the Google Groups "nitro-devel" group.
To post to this group, send email to nitro...@googlegroups.com.
To unsubscribe from this group, send email to nitro-devel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nitro-devel?hl=en.




--
http://www.gmosx.com/blog
Reply all
Reply to author
Forward
0 new messages