Ashok Krishnamoorthy
Ashok Krishnamoorthy

Reputation: 873

Deliver json file via Angular routing

I need to deliver a static json file in my angular application for an external provider to use.

for example: http://angular-app-url:4200/app-test.json

When I do routing, it is always for a component or its just redirect to another path. how can I achieve this to deliver this json file?

Upvotes: 0

Views: 1724

Answers (1)

Johan Swanepoel
Johan Swanepoel

Reputation: 482

In your angular.json file under options look for the assets entry and add the following:

"assets": [
    "src/path_to_your_file/app-test.json",
]

Upvotes: 1

Related Questions