1 parent
9713435620
commit
88569f8a40
43 files changed
+3139
No files matched your search
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Required External Modules and Interfaces
|
||||
*/
|
||||
import express, {Request, Response} from 'express';
|
||||
import {Guid} from 'guid-typescript';
|
||||
import logger from '../../middleware/logger';
|
||||
import {productsRouter} from './products/products.router';
|
||||
import {contactpersonsRouter} from './contact_persons/contact_persons.router';
|
||||
import {pricealarmsRouter} from './pricealarms/pricealarms.router';
|
||||
import {usersRouter} from './users/users.router';
|
||||
import {pricesRouter} from './prices/prices.router';
|
||||
import {vendorsRouter} from './vendors/vendors.router';
|
||||
import {categoriesRouter} from './categories/categories.router';
|
||||
import {manufacturersRouter} from './manufacturers/manufacturers.router';
|
||||
import {favoriteshopsRouter} from './favorite_shops/favoriteshops.router';
|
||||
import {crawlingstatusRouter} from './crawling_status/crawling_status.router';
|
||||
|
||||
/**
|
||||
* Router Definition
|
||||
*/
|
||||
export const betterzonRouter = express.Router();
|
||||
|
||||
betterzonRouter.use('/products', productsRouter);
|
||||
betterzonRouter.use('/categories', categoriesRouter);
|
||||
betterzonRouter.use('/manufacturers', manufacturersRouter);
|
||||
betterzonRouter.use('/prices', pricesRouter);
|
||||
betterzonRouter.use('/users', usersRouter);
|
||||
betterzonRouter.use('/vendors', vendorsRouter);
|
||||
betterzonRouter.use('/pricealarms', pricealarmsRouter);
|
||||
betterzonRouter.use('/contactpersons', contactpersonsRouter);
|
||||
betterzonRouter.use('/favoriteshops', favoriteshopsRouter);
|
||||
betterzonRouter.use('/crawlingstatus', crawlingstatusRouter);
|
||||
|
||||
|
||||
betterzonRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
res.status(200).send('Pluto Development PartyPlaner API Endpoint V2');
|
||||
} catch (e) {
|
||||
let errorGuid = Guid.create().toString();
|
||||
logger.error('Error handling a request: ' + e.message, {reference: errorGuid});
|
||||
res.status(500).send({
|
||||
'status': 'PROCESSING_ERROR',
|
||||
'message': 'Internal Server Error. Try again later.',
|
||||
'reference': errorGuid
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user