All Projects → HashLoad → horse-cors

HashLoad / horse-cors

Licence: MIT license
No description or website provided.

Programming Languages

pascal
1382 projects

Projects that are alternatives of or similar to horse-cors

laravel-cors
Laravel cors
Stars: ✭ 19 (-38.71%)
Mutual labels:  cors
sanic-ext
Extended Sanic functionality
Stars: ✭ 26 (-16.13%)
Mutual labels:  cors
laravel-api-boilerplate-passport
An API Boilerplate to create a ready-to-use REST API in seconds.
Stars: ✭ 20 (-35.48%)
Mutual labels:  cors
upload-file-to-backblaze-b2-from-browser-example
Demonstrates calling the b2_upload_file Backblaze B2 Cloud Storage API from a web browser using AJAX.
Stars: ✭ 28 (-9.68%)
Mutual labels:  cors
aws-lambda-router
Improved routing for AWS Lambda like SNS and ApiGateway
Stars: ✭ 90 (+190.32%)
Mutual labels:  cors
apollobank
A full stack GraphQL banking application using React, Node & TypeScript.
Stars: ✭ 203 (+554.84%)
Mutual labels:  cors
drf-starter-template
DRF Starter Template with drf-yasg, heroku deployment ready config, CORS config
Stars: ✭ 25 (-19.35%)
Mutual labels:  cors
lua-resty-cors
It's the implement of CORS on OpenResty
Stars: ✭ 53 (+70.97%)
Mutual labels:  cors
BarterOnly
An ecommerce platform to buy or exchange items at your convenience
Stars: ✭ 16 (-48.39%)
Mutual labels:  cors
gotify-push
Chrome Extension for Send Push Notification 🔔 to gotify/server ☁
Stars: ✭ 32 (+3.23%)
Mutual labels:  cors
horse-wizard
Wizard for HORSE projects
Stars: ✭ 36 (+16.13%)
Mutual labels:  horse
CORS-Proxy-Server
代理转发 CORS 跨域资源请求
Stars: ✭ 13 (-58.06%)
Mutual labels:  cors
terraform-aws-api-gateway-enable-cors
Easily add an OPTIONS method to an API Gateway resource to enable CORS
Stars: ✭ 56 (+80.65%)
Mutual labels:  cors
simple-cors
Simply usable CORS middleware / interceptor for Clojure
Stars: ✭ 26 (-16.13%)
Mutual labels:  cors
node-typescript-starter
REST API using Node with typescript, KOA framework. TypeORM for SQL. Middlewares JWT (auth), CORS, Winston Logger, Error, Response
Stars: ✭ 19 (-38.71%)
Mutual labels:  cors
realestate
A simple real estate app build with MEAN( Angular, Node and mongoDb ) and MERN( React, Node and mongoDb )
Stars: ✭ 33 (+6.45%)
Mutual labels:  cors
Natours
An awesome tour booking web app written in NodeJS, Express, MongoDB 🗽
Stars: ✭ 94 (+203.23%)
Mutual labels:  cors
koa-restful-boilerplate
A boilerplate for koa2 RESTful API development
Stars: ✭ 31 (+0%)
Mutual labels:  cors
poop
Firefox extension that prevents sending Origin headers when they are least likely to be necessary, to protect your privacy.
Stars: ✭ 36 (+16.13%)
Mutual labels:  cors
keycloak-spring-boot-rest-angular-demo
Demo for configuring Keycloak authentication for a spring-boot rest service and AngularJs web client
Stars: ✭ 24 (-22.58%)
Mutual labels:  cors

horse-cors

horse-cors is a official middleware for handling CORS in APIs developed with the Horse framework.
We created a channel on Telegram for questions and support:

What's CORS?

Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources. CORS also relies on a mechanism by which browsers make a "preflight" request to the server hosting the cross-origin resource, in order to check that the server will permit the actual request. In that preflight, the browser sends headers that indicate the HTTP method and headers that will be used in the actual request.

An example of a cross-origin request: the front-end JavaScript code served from https://domain-a.com uses XMLHttpRequest to make a request for https://domain-b.com/data.json.

For security reasons, browsers restrict cross-origin HTTP requests initiated from scripts. For example, XMLHttpRequest and the Fetch API follow the same-origin policy. This means that a web application using those APIs can only request resources from the same origin the application was loaded from unless the response from other origins includes the right CORS headers.

The CORS mechanism supports secure cross-origin requests and data transfers between browsers and servers. Modern browsers use CORS in APIs such as XMLHttpRequest or Fetch to mitigate the risks of cross-origin HTTP requests.

Read more in https://developer.mozilla.org

⚙️ Installation

Installation is done using the boss install command:

boss install horse-cors

If you choose to install manually, simply add the following folders to your project, in Project > Options > Resource Compiler > Directories and Conditionals > Include file search path

../horse-cors/src

✔️ Compatibility

This middleware is compatible with projects developed in:

  • Delphi
  • Lazarus

⚡️ Quickstart Delphi

uses
  Horse,
  Horse.CORS, // It's necessary to use the unit
  System.SysUtils;

begin
  // You can configure CORS as in the example below:

  // HorseCORS
  //   .AllowedOrigin('*')
  //   .AllowedCredentials('true')
  //   .AllowedHeaders('*')
  //   .AllowedMethods('*')
  //   .ExposedHeaders('*');

  // It's necessary to add the middleware in the Horse:
  THorse.Use(CORS);

  THorse.Get('/ping',
    procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)
    begin
      Res.Send('pong');
    end);

  THorse.Listen(9000);
end.

⚡️ Quickstart Lazarus

{$MODE DELPHI}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Horse,
  Horse.CORS, // It's necessary to use the unit
  SysUtils;

procedure GetPing(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);
begin
  Res.Send('Pong');
end;

begin
  // You can configure CORS as in the example below:

  // HorseCORS
  //   .AllowedOrigin('*')
  //   .AllowedCredentials('true')
  //   .AllowedHeaders('*')
  //   .AllowedMethods('*')
  //   .ExposedHeaders('*');

  // It's necessary to add the middleware in the Horse:
  THorse.Use(CORS);

  THorse.Get('/ping', GetPing);

  THorse.Listen(9000);
end.

⚠️ License

horse-cors is free and open-source middleware licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].