Browse Source

qf

master
Krzysztof Sikorski 5 years ago
parent
commit
811d6ed917
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      index.js

+ 2
- 1
index.js

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

Loading…
Cancel
Save