Skip to content

Instantly share code, notes, and snippets.

View apresentacao.js
var tiposDeApresentacoes = require('valueObjects').tiposDeApresentacoes;
var apresentacaoSchema = new Schema({
tipo: [{ type: String, enum: tiposDeApresentacoes }],
titulo: { type: String, max: 80 },
descricao: { type: String, max: 200 }
});
View valueObjects.js
exports.tiposDeApresentacoes = ['Debate', 'Palestra', 'WorkShop', 'StandUP', 'Mesa Redonda'];
View index.js
var express = require('express');
var router = express.Router();
var formidable = require('formidable');
var Uploader = require('../helpers/s3-uploader');
router.post('/enviar', function (req, res, next) {
var form = new formidable.IncomingForm();
form.parse(req, function(err, fields, files) {
if (err) {
return next(err);
You can’t perform that action at this time.