BVB Source Codes

parse-server Show InstallationsRouter.js Source code

Return Download parse-server: download InstallationsRouter.js Source code - Download parse-server Source code - Type:.js
  1. // InstallationsRouter.js
  2.  
  3. import ClassesRouter from './ClassesRouter';
  4. import rest from '../rest';
  5.  
  6. export class InstallationsRouter extends ClassesRouter {
  7.   handleFind(req) {
  8.     const body = Object.assign(req.body, ClassesRouter.JSONFromQuery(req.query));
  9.     var options = {};
  10.  
  11.     if (body.skip) {
  12.       options.skip = Number(body.skip);
  13.     }
  14.     if (body.limit || body.limit === 0) {
  15.       options.limit = Number(body.limit);
  16.     }
  17.     if (body.order) {
  18.       options.order = String(body.order);
  19.     }
  20.     if (body.count) {
  21.       options.count = true;
  22.     }
  23.     if (body.include) {
  24.       options.include = String(body.include);
  25.     }
  26.  
  27.     return rest.find(req.config, req.auth,
  28.       '_Installation', body.where, options, req.info.clientSDK)
  29.       .then((response) => {
  30.         return {response: response};
  31.       });
  32.   }
  33.  
  34.   handleGet(req) {
  35.     req.params.className = '_Installation';
  36.     return super.handleGet(req);
  37.   }
  38.  
  39.   handleCreate(req) {
  40.     req.params.className = '_Installation';
  41.     return super.handleCreate(req);
  42.   }
  43.  
  44.   handleUpdate(req) {
  45.     req.params.className = '_Installation';
  46.     return super.handleUpdate(req);
  47.   }
  48.  
  49.   handleDelete(req) {
  50.     req.params.className = '_Installation';
  51.     return super.handleDelete(req);
  52.   }
  53.  
  54.   mountRoutes() {
  55.     this.route('GET','/installations', req => { return this.handleFind(req); });
  56.     this.route('GET','/installations/:objectId', req => { return this.handleGet(req); });
  57.     this.route('POST','/installations', req => { return this.handleCreate(req); });
  58.     this.route('PUT','/installations/:objectId', req => { return this.handleUpdate(req); });
  59.     this.route('DELETE','/installations/:objectId', req => { return this.handleDelete(req); });
  60.   }
  61. }
  62.  
  63. export default InstallationsRouter;
  64.  
downloadInstallationsRouter.js Source code - Download parse-server Source code
Related Source Codes/Software:
react-boilerplate - 2017-06-07
webtorrent - Streaming torrent client for the web ... 2017-06-06
machine-learning-for-software-engineers - A complete daily plan for studying to become a mac... 2017-06-06
upterm - A terminal emulator for the 21st century. 2017-06-06
lottie-android - Render After Effects animations natively on Androi... 2017-06-07
AsyncDisplayKit - Smooth asynchronous user interfaces for iOS apps. ... 2017-06-07
ionicons - The premium icon font for Ionic ... 2017-06-07
storybook - 2017-06-07
prettier - Prettier is an opinionated JavaScript formatter. ... 2017-06-08
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top