|
|
@ -9,11 +9,12 @@ mongoose.connect("mongodb://mongo/events", { useNewUrlParser: true }); |
|
|
|
|
|
|
|
|
const Schema = mongoose.Schema; |
|
|
const Schema = mongoose.Schema; |
|
|
const EventSchema = new Schema({}, { strict: false }); |
|
|
const EventSchema = new Schema({}, { strict: false }); |
|
|
|
|
|
const Event = mongoose.model("Event", EventSchema); |
|
|
|
|
|
|
|
|
app.use(bodyParser.json()); |
|
|
app.use(bodyParser.json()); |
|
|
|
|
|
|
|
|
app.post("/", (req, res) => { |
|
|
app.post("/", (req, res) => { |
|
|
EventSchema.create(req.body); |
|
|
|
|
|
|
|
|
Event.create(req.body); |
|
|
res.send("OK"); |
|
|
res.send("OK"); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|