Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make file available at route Angular 7

I'm facing a problem I don't know how to resolve.

I'm trying to integrate my website with Apple Pay using Stripe's PaymentRequest. However, I'm having trouble with one of their requisites. I don't know how to make that file available at the route

https://exampledomain.com/.well-known/apple-developer-merchantid-domain-association 

Can somebody help with this please?

like image 403
BalB Avatar asked Jul 11 '26 12:07

BalB


2 Answers

Exact example for OP's question,

Step 1: Create folder in src names .well-known

Step 2: Add apple-developer-merchantid-domain-association file inside .well-known folder

Step 3: Add 2 lines in angular.json assets

"src/.well-known/apple-developer-merchantid-domain-association",
{ "glob": "apple-developer-merchantid-domain-association", "input": "src/.well-known/", "output": "/" },

The final assets will look something like this,

"assets": [
              "src/.well-known/apple-developer-merchantid-domain-association",
              { "glob": "apple-developer-merchantid-domain-association", "input": "src/.well-known/", "output": "/" },
              "src/favicon.ico",
              "src/assets",
              "src/manifest.webmanifest"
            ],

Now, You should be able to access the file on: http://localhost:4200/.well-known/apple-developer-merchantid-domain-association

like image 91
Mohammad Zaid Pathan Avatar answered Jul 14 '26 02:07

Mohammad Zaid Pathan


If you wish to move some static files to build paths you can use angular.json for example:

{
  ...
  "projects": {
    ...
    "#project_name#": {
      ...
      "architect": {
        ...
        "build": {
          ...
          "options": {
            "outputPath": "./build/path/to/project-root/",
            ...
            "assets": [ { "glob": "*", "input": "./src/static", "output": "." },
...

This would move files inside ./src/static folder to build/path/to/project-root/ the output path depends on some build configuration like --output-path and maybe something else.

like image 27
Xesenix Avatar answered Jul 14 '26 01:07

Xesenix