GithubHelp home page GithubHelp logo

thehuijb / thehuijb.sc.enablewebapi Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 192 KB

Applies the necessary hooks to enable custom WebApi controllers in a Sitecore project

License: MIT License

Pascal 100.00%

thehuijb.sc.enablewebapi's Introduction

Thehuijb.SC.EnableWebApi

this is a fork of DEG.Shared.SC.EnableWebApi, thanks to Patrick Delancy

  • I removed the testcontroller cause I don't need it.
  • I changed AbortSitecoreForKnownRoutes.cs to only abort for the web api route set in RegisterWebApiRoute.cs

This module applies the hooks necessary to enable custom WebApi controllers in a Sitecore project.

Registering Routes

The default WebApi route is registered for you in the /WebApi/RegisterWebApiRoute.cs You can modify the route here. (if you want to add routes, make sure you check for them in the AbortSitecoreForKnownRoutes.cs)

Sitecore Pipeline Integration

This module hooks into 2 places in the Sitecore pipeline:

  • initialize pipeline, in order to register the WebApi routes
  • httpRequestBegin pipeline, in order to detect WebApi requests, and abort the Sitecore pipeline as necessary

Sitecore Context

Because the WebApi routes are detected near the middle of the httpRequestBegin pipeline, the static Sitecore context objects are constructed and available for use from within the WebApi controllers!

Config Patching

This module uses Sitecore Config patching to hook into the appropriate pipelines. All of this magic happens in /App_Config/Include/WebApi.Thehuijb.SC.Enable.config You are recommended NOT to modify this file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.