API Create a bucket with CORS rules
API: Create a bucket with CORS-rules
Creation of a Bucket with CORS-rules
In order to create a bucket, the following API Request needs to be done:
In the Request-Body the following attributes can be applied:
ACL
:private
public-read
public-read-write
authenticated-read
Region
:eu-central-1
eu-west-1
Example (please note that in staging mode the hostname may be different):
Applying CORS:
In order to be able to upload files from your own frontend to the bucket with a pre-signed URL, a few precautions must be taken beforehand.
Letβs say, your Frontend is located at the Host berlin-marketplace.nft
we have to setup a CORS rule accordingly:
The request body must contain a structure that lists the HTTP methods allowed, the origins allowed, etc:
AllowedHeaders
*(all headers)
AllowedMethods
POST
PUT
GET
DELETE
OPTIONS
AllowedOrigins
*(all hostnames, unsafe!)
localhost
marketplace.stage.tokenforge.tech
ExposedHeaders
MaxAgeSeconds
Example (please note that in staging mode the hostname may be different):
Warning: any subsequent call to this endpoint will overwrite existing CORS rules!
Last updated