Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. const mongoose = require('mongoose');
  2. const bodyParser = require('body-parser');
  3.  
  4. const app = express();
  5. app.use(bodyParser.urlencoded({ extended: true }));
  6. app.use(express.json({ extended: false }))
  7. app.use(function (req, res, next) {
  8. res.header("Access-Control-Allow-Origin", "*");
  9. res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  10. next();
  11. });
  12.  
  13.  
  14. mongoose.connect('URL Something', {
  15. useNewUrlParser: true
  16. });
  17.  
  18. const signUpSchema = new mongoose.Schema({
  19. first_name: String,
  20. last_name: String,
  21. password: String,
  22. email: String,
  23. phone: String,
  24.  
  25. })
  26. const User_details = mongoose.model('User_details', signUpSchema)```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement