removed extra file, un-comment /cars api

Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
This commit is contained in:
Nakul Manchanda
2020-02-09 01:03:32 -05:00
parent c353f834a2
commit 6aa526a638
7 changed files with 448 additions and 498 deletions

851
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -128,11 +128,9 @@ const app = express();
//TODO: use for whitelist only
app.use(cors());
const routes = require('./routes/index.route');
const cli = require('./cli/index.route');
app.get('/', (req, res) => res.send('Hello World!'));
app.use(routes);
app.use('/cli', cli);
// const httpServer = http.createServer(app);
const httpsServer = https.createServer(credentials, app);

View File

@@ -1,25 +0,0 @@
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright IBM Corporation 2020
*/
const express = require('express');
const router = express.Router({ mergeParams: true });
const accountsController = require('../controllers/accounts.controller');
const accountsCarsRoute = require('./accountsCars.route');
router.route('/')
.get(accountsController.getAll);
router.route('/:_id')
.get(accountsController.get);
router.use('/:Account_id', accountsCarsRoute);
module.exports = router;

View File

@@ -1,22 +0,0 @@
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright IBM Corporation 2020
*/
const express = require('express');
const router = express.Router({ mergeParams: true });
const accountsCarsController = require('../controllers/accountsCars.controller');
router.route('/cars')
.get(accountsCarsController.getAll);
router.route('/cars/:_id')
.get(accountsCarsController.get);
module.exports = router;

View File

@@ -1,22 +0,0 @@
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright IBM Corporation 2020
*/
const express = require('express');
const router = express.Router({ mergeParams: true });
const carsController = require('../controllers/cars.controller');
router.route('/')
.get(carsController.getAll);
router.route('/:_id')
.get(carsController.get);
module.exports = router;

View File

@@ -1,20 +0,0 @@
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright IBM Corporation 2020
*/
const express = require('express');
const cars = require('./cars.route');
const accounts = require('./accounts.route');
const router = express.Router();
router.use('/cars', cars);
router.use('/accounts', accounts);
module.exports = router;

View File

@@ -13,7 +13,7 @@ const router = express.Router({ mergeParams: true });
const accountsCarsController = require('../controllers/accountsCars.controller');
/*
// Add missing feature
// un-comment this to implement two new routes
// accounts/:id/cars & accounts/:id/cars/:id2
@@ -23,6 +23,6 @@ router.route('/cars')
router.route('/cars/:_id')
.get(accountsCarsController.get);
*/
module.exports = router;