Last active
December 24, 2020 21:23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const cors = require('cors'); | |
const app = express(); | |
app.use(bodyParser.json({limit:"30mb"})); | |
app.use(bodyParser.urlencoded({ extended: true })); | |
app.use(cors()); | |
const port = 9000; | |
const imgarray = [] | |
app.post('/receive',async (req,res) =>{ | |
const received = req.body; | |
imgarray.push(received.base64); | |
console.log(imgarray); | |
res.send(imgarray); | |
// await dbSchema.create(received, (err, data) =>{ | |
// if(err){ | |
// res.status(500).send(err); | |
// } | |
// else{ | |
// res.status(201).send(data); | |
// } | |
// }) | |
}) | |
app.listen(port,() => (console.log(`Listening on ${port}`))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment