Permalink
Browse files

setting api

  • Loading branch information...
seheesf88 committed Feb 9, 2019
1 parent 6ebdd35 commit 7c561320635e821a4f86268a30500d8fb6bd5c52
Showing with 668 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +26 −0 controllers/flightController.js
  3. +20 −0 db/db.js
  4. 0 models/flight.js
  5. +561 −1 package-lock.json
  6. +23 −0 package.json
  7. +37 −0 server.js
@@ -0,0 +1 @@
node_modules
@@ -0,0 +1,26 @@
const express = require('express');
const router = express.Router();
const Flight = require('../models/flight');


router.get('/', (res, req) => {
req.send('hi')
});

router.get('/:id', (res, req) => {
});

router.post('/:id', (res, req) => {

});

router.put('/:id', (res, req) => {

});

router.delete('/', (res, req) => {

});


module.exports = router
@@ -0,0 +1,20 @@
const mongoose = require('mongoose');
const connectionString = 'mongodb://localhost/flight'

mongoose.connect(connectionString, {
useNewUrlParser: true,
useCreateIndex: true,
useFindAndModify: false
});

mongoose.connection.on('connected', () => {
console.log(`mongoose connected to ${connectionString}`)
})

mongoose.connection.on('error', (err) =>{
console.log(`mongoose error `, err)
})

mongoose.connection.on('disconnected', () =>{
console.log(`mongoose disconnected from ${connectionString}`)
})
No changes.
Oops, something went wrong.

0 comments on commit 7c56132

Please sign in to comment.