Skip to content

After automatic deploy, 'Error: ENOENT: no such file or directory' occurs #2

@Gs1TestTeam

Description

@Gs1TestTeam
  1. Change "outputPath": "dist", part in angular.js
  2. Change "outDir": "./dist", part in tsconfig.json
  3. Match the directory in server.js

// setup the static folder
app.use(express.static(__dirname + "/dist"));

// handle "404" errors
app.use((req, res) => {
res.sendFile(path.join(__dirname + "/dist/index.html"));
});

See more:
https://stackoverflow.com/questions/37348045/how-to-change-the-dist-folder-path-in-angular-cli-after-ng-build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions