We.js plugin do add csv response type and set we.csv
attribute with https://github.com/wdavidw/node-csv module
we i we-plugin-csv
file: config/local.js
csv: {
// configure your model coluns with this
modelColumns: {
// Example for user model:
user: {
userId: 'id',
displayName: 'displayName',
fullName: 'fullName',
biography: 'biography',
gender: 'gender'
}
}
}
// in your controller
res.locals.csvResponseColumns = {
userId: 'id',
displayName: 'displayName',
fullName: 'fullName',
biography: 'biography',
status: 'gender'
};
http://localhost:4000/user.csv
- See https://github.com/wdavidw/node-csv how will be avaible in
we.csv
- We.js site: http://wejs.org
Under the MIT license.