mirror of
https://github.com/jlengrand/sample-node-api.git
synced 2026-03-10 15:52:20 +00:00
removed extra file, un-comment /cars api
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
This commit is contained in:
851
package-lock.json
generated
851
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user