Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const mongoose = require('mongoose');
- const bodyParser = require('body-parser');
- const app = express();
- app.use(bodyParser.urlencoded({ extended: true }));
- app.use(express.json({ extended: false }))
- app.use(function (req, res, next) {
- res.header("Access-Control-Allow-Origin", "*");
- res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
- next();
- });
- mongoose.connect('URL Something', {
- useNewUrlParser: true
- });
- const signUpSchema = new mongoose.Schema({
- first_name: String,
- last_name: String,
- password: String,
- email: String,
- phone: String,
- })
- const User_details = mongoose.model('User_details', signUpSchema)```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement