当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Express.put方法代码示例

本文整理汇总了TypeScript中express.Express.put方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Express.put方法的具体用法?TypeScript Express.put怎么用?TypeScript Express.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在express.Express的用法示例。


在下文中一共展示了Express.put方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: addCreateUser

 private static addCreateUser(app: Express) {
   app.put('/api/user',
     AuthenticationMWs.authenticate,
     AuthenticationMWs.authorise(UserRoles.Admin),
     UserMWs.createUser,
     RenderingMWs.renderOK
   );
 }
开发者ID:bpatrik,项目名称:PiGallery2,代码行数:8,代码来源:UserRouter.ts

示例2: defineRoutes

 defineRoutes(): void {
     this.app.get(RestService.generateRoute(Api.CHARACTERS, CharactersActions.getCharacterById), this.charactersComponent.getCharactersById);
     this.app.get(RestService.generateRoute(Api.CHARACTERS, CharactersActions.getCharacters), this.charactersComponent.getCharacters);
     this.app.post(RestService.generateRoute(Api.CHARACTERS, CharactersActions.createCharacters), this.charactersComponent.createCharacter);
     this.app.put(RestService.generateRoute(Api.CHARACTERS, CharactersActions.updateCharacterById), this.charactersComponent.updateCharacterById);
     this.app.delete(RestService.generateRoute(Api.CHARACTERS, CharactersActions.removeCharacterById), this.charactersComponent.removeCharacterById);
     this.app.post(RestService.generateRoute(Api.CHARACTERS, CharactersActions.searchCharacters), this.charactersComponent.searchCharacters);
 }
开发者ID:EmcaBorg,项目名称:got,代码行数:8,代码来源:charactersRoutes.ts

示例3: RegisterRoutes

    RegisterRoutes()
    {
         var self = this;

        this.app.put('/api/user', this.userController.Create);
        this.app.post('/api/user/:id', this.userController.Update);
        this.app.delete('/api/user/:id', this.userController.Delete);
        this.app.get('/api/user', function(req, res){
           self.onInit();
            return self.userController.GetByQuery(req, res);
        });       
        this.app.get('/api/user/:id',  function(req, res){
            self.onInit();
            return self.userController.GetById(req, res);
        });
    }
开发者ID:ramesh-sharma12,项目名称:email-client,代码行数:16,代码来源:User.ts

示例4: RegisterRoutes

 RegisterRoutes()
 {   
     var self = this;
     this.app.get('/api/email/getSummary', this.emailController.GetSummary)
     this.app.put('/api/email', this.emailController.Create);
     this.app.post('/api/email/:id', this.emailController.Update);
     this.app.delete('/api/email/:id', this.emailController.Delete);
      this.app.get('/api/email', function (req, res) {
         // body...
         self. onInit();
         return self.emailController.GetByQuery(req, res)
     });   
     this.app.get('/api/email/:id', function (req, res) {
         // body...
         self. onInit();
         return self.emailController.GetById(req, res)
     }); 
 }
开发者ID:ramesh-sharma12,项目名称:email-client,代码行数:18,代码来源:Email.ts

示例5: RegisterRoutes

    RegisterRoutes()
    {  
         var self = this;
        this.app.put('/api/profile', this.profileController.Create);
        this.app.post('/api/profile/:id', this.profileController.Update);
        this.app.delete('/api/profile/:id', this.profileController.Delete);
        this.app.get('/api/profile', function (req, res) {
            // body...
          self.onInit();

            return self.profileController.GetByQuery(req, res)
        });       
        this.app.get('/api/profile/:id', function (req, res) {
            // body...
          self.onInit();

            return self.profileController.GetById(req, res)
        })
    }
开发者ID:ramesh-sharma12,项目名称:email-client,代码行数:19,代码来源:Profile.ts

示例6: addSettings

  private static addSettings(app: Express) {
    app.get('/api/settings',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      RenderingMWs.renderConfig
    );


    app.put('/api/settings/database',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateDatabaseSettings,
      RenderingMWs.renderOK
    );

    app.put('/api/settings/map',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateMapSettings,
      RenderingMWs.renderOK
    );
    app.put('/api/settings/video',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateVideoSettings,
      RenderingMWs.renderOK
    );
    app.put('/api/settings/metafile',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateMetaFileSettings,
      RenderingMWs.renderOK
    );

    app.put('/api/settings/authentication',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateAuthenticationSettings,
      RenderingMWs.renderOK
    );
    app.put('/api/settings/thumbnail',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateThumbnailSettings,
      RenderingMWs.renderOK
    );
    app.put('/api/settings/search',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateSearchSettings,
      RenderingMWs.renderOK
    );
    app.put('/api/settings/share',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateShareSettings,
      RenderingMWs.renderOK
    );
    app.put('/api/settings/randomPhoto',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateRandomPhotoSettings,
      RenderingMWs.renderOK
    );
    app.put('/api/settings/basic',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateBasicSettings,
      RenderingMWs.renderOK
    );
    app.put('/api/settings/other',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateOtherSettings,
      RenderingMWs.renderOK
    );
    app.put('/api/settings/indexing',
      AuthenticationMWs.authenticate,
      AuthenticationMWs.authorise(UserRoles.Admin),
      AdminMWs.updateIndexingSettings,
      RenderingMWs.renderOK
    );
  }
开发者ID:bpatrik,项目名称:PiGallery2,代码行数:83,代码来源:AdminRouter.ts

示例7: registerRoutes

export function registerRoutes(app: Express) {
    
    // My kingdom for a function composition operator
    const canUserReserve = middlewarify(Capabilities.Lodging.canUserReserveAP);
    const canExternalReserve = middlewarify(Capabilities.Lodging.canExternalReserveAP);
    const isOwnerOf = middlewarify(Capabilities.Lodging.isOwnerOfAP);
    const canPostLodgings = middlewarify(Capabilities.Lodging.canPostAP);
    const canAccessReservation = middlewarify(Capabilities.Reservation.canAccessAP);
    const canManipulateAmenities = middlewarify(Capabilities.Amenities.canManipulateAP);
    const canAccessUser = middlewarify(Capabilities.User.canAccessUserAP);

    app.get("/", Index.get);

    app.get("/login", Login.get);
    app.get("/register", Register.get);
    app.get("/me", isLoggedIn, Me.get);
    app.get("/user/:id", canAccessUser, User.get);
    app.get("/users", middlewarify(promisify(Role.isAdminP)), Users.get);

    app.get("/seller_application", SellerApplication.get);

    app.get("/lodgings", Lodgings.get);
    app.get("/lodgings/new", canPostLodgings, NewLodging.get);
    app.get("/lodgings/:id/reservations/user/new", canUserReserve, NewUserReservation.get);
    app.get("/lodgings/:id/reservations/external/new", canExternalReserve, NewExternalReservation.get);
    app.get("/lodgings/:id/reservations", isOwnerOf, LodgingReservations.get);
    app.get("/lodgings/:id", Lodging.get);
    app.get("/lodgings/:id/edit", isOwnerOf, EditLodging.get);
    
    app.get("/my_lodgings", canPostLodgings, MyLodgings.get);
    
    app.get("/my_reservations", isLoggedIn, MyReservations.get);
    app.get("/reservations/:id", canAccessReservation, Reservation.get);    
    app.get("/mock/payment_provider/:id", canAccessReservation, PaymentProvider.get);
    
    // NOT SECURED. In a real-world system this would use access tokens and domain whitelisting.
    app.post("/api/v1/mock/payment_callback", isLoggedIn, PaymentCallbackApi.post);
    
    app.get("/amenities", canManipulateAmenities, Amenities.get);    
    
    app.post("/api/v1/login", LoginApi.post);
    app.post("/api/v1/logout", isLoggedIn, LogoutApi.post);
    
    app.get("/api/v1/my_lodgings", canPostLodgings, MyLodgingsApi.get);
    app.get("/api/v1/lodgings", LodgingSearchApi.get);
    app.post("/api/v1/lodgings/new", canPostLodgings, NewLodgingApi.post);
    
    // These two routes handle their own access control
    app.post("/api/v1/reservations/user", NewUserReservationApi.post);
    app.post("/api/v1/reservations/external", NewExternalReservationApi.post);
    
    app.get("/api/v1/lodgings/:id/reservations/bounds", ReservationBoundsApi.get);
    
    app.post("/api/v1/lodgings/:id/publish", isOwnerOf, PublishLodgingApi.post);
    app.post("/api/v1/lodgings/:id/unpublish", isOwnerOf, UnpublishLodgingApi.post);
    app.put("/api/v1/lodgings/:id", isOwnerOf, LodgingApi.put);
    app.get("/api/v1/lodgings/:id", isOwnerOf, LodgingApi.get);
    
    app.get("/api/v1/amenities", AmenitiesApi.get);
    app.post("/api/v1/amenities", canManipulateAmenities, AmenitiesApi.post);
    app.delete("/api/v1/amenities/:id", canManipulateAmenities, AmenitiesApi.delete);
    app.put("/api/v1/amenities/:id", canManipulateAmenities, AmenitiesApi.put);
    
    app.get("/api/v1/users/:email/available", EmailAvailableApi.get);
    app.post("/api/v1/users", NewUserApi.post);
    
    app.post("/api/v1/seller_application", isLoggedIn, NewSellerApplicationApi.post);
    app.post("/api/v1/users/:id/approve_application", middlewarify(promisify(Role.isAdminP)), ApproveApplicationApi.post);
}
开发者ID:paavohuhtala,项目名称:lodgist,代码行数:69,代码来源:Routes.ts

示例8: defineRoutes

 defineRoutes(): void {
     this.app.get(RestService.generateRoute(Api.USERS, UsersActions.getUserById), this.usersComponent.getUserById);
     this.app.post(RestService.generateRoute(Api.USERS, UsersActions.createUser), this.usersComponent.createUser);
     this.app.put(RestService.generateRoute(Api.USERS, UsersActions.updateUserById), this.usersComponent.updateUserById);
     this.app.delete(RestService.generateRoute(Api.USERS, UsersActions.deleteUserById), this.usersComponent.deleteUserById);
 }
开发者ID:EmcaBorg,项目名称:got,代码行数:6,代码来源:usersRoutes.ts


注:本文中的express.Express.put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。