question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

assets are pulled in from angular.json, but not served?

See original GitHub issue

I added src/api to my assets for an angular app. Stackblit pulled them in, but when I try to access the files via http in angular, i get an error. It returns a status code of 200 as it brings in the index.html.

            "assets": [
              "src/api",
              "src/favicon.ico",
              "src/assets"
            ],

I am trying to hit it with code like this:

  getCharacters(storyId: number) {
    return this.http
      .get('api/characters.json')
      .map((response: Response) => response.json().data);
  }

How can I add a folder like this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
djtahlcommented, Nov 21, 2018

Any updates on the topic ? this is a real pain that will prevent more and more users from using stackblitz no ?

0reactions
pct-cclausencommented, Aug 25, 2022

I seem to be running into this as well, is this not fixed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exclude assets in production build - angular
ng serve should serve files contained in the folder ./assets-non-build. but: ng build should not inculde the folder ./assets-non-build in the ...
Read more >
Angular workspace configuration
The angular.json file at the root level of an Angular workspace provides workspace-wide and project-specific configuration defaults.
Read more >
Angular CLI: Different ways to include assets - Łukasz Nojek
In this article I will discuss several methods of adding and referring to static files in an Angular CLI application – may they...
Read more >
Build & Serve 3rd party Assets and Static files — Angular
Let's go to angular.json and add the glob section to ensure the assets are copied over during build(either on pipeline or for local...
Read more >
single-spa-angular
Note that the schematics for Angular 7 use an Angular Builder that is no ... Add build:single-spa and serve:single-spa to the scripts in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found