0

I am new to angular universal and I am trying to expose a json file in route. I want to expose a json file via a route like the code below. How can I achieve this in angular universal?

  // Redirect root path to /atlassian-connect.json,
    // which will be served by atlassian-connect-express.
    app.get('/', (req, res) => {
        res.redirect('/atlassian-connect.json');
    });
Umar
  • 55
  • 1
  • 7

1 Answers1

0

I would make a component and get the file with http:

this.http.get('./atlassian-connect.json').subscribe(data => {
    // set json file to variable
})

Then, when you display the json, use the json pipe:

{{fileContents | json}}