从弹性beanstalk提供静态文件不起作用

我得到了一个angular色的应用程序,从本地主机工作得很好,但在豆茎它没有提供所有我的文件。 只有我的index.html和styles.css被find并提供,都在一个名为public的文件夹中。 我的构build文件是在path/build/build.js,它不会服务它,但在本地主机它会。

我目前只是从我的服务器提供的文件,而不是使用staticfiles.config,因为这是完全不工作。

文件夹结构:

root: /public : index.html ,styles.css /src: modularized angular and htmls for routes . /build: build.js 
 const express = require('express'); const path = require('path'); const fs = require('fs'); const bodyParser = require('body-parser'); const emailController = require('./controllers/emailController'); const app = express(); const port = process.env.PORT || 3000; app.use(bodyParser.json()); app.use(express.static(path.resolve(__dirname, '../public'))); app.use(express.static(path.resolve(__dirname, '../'))); app.post('/email', emailController); app.listen(port, () => { console.log(`Server is listening on mfing ${port}`); }); 
 <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta name="description" content="Hydration Packs and Cooler Bags for Hiking, Outdoors, Work, Festivals, Biking and More"> <link rel="stylesheet" type="text/css" href="./styles.css"> <script src="/node_modules/angular/angular.js"></script> <script src="/node_modules/angular-route/angular-route.js"></script> <script src="/build/build.js"></script> <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"> <title>Hydration Packs and Cooler bags | Absolute Zero</title> </head> 

这是我的服务器和我的index.html头。 有人知道什么是错的? 谢谢。

用这个replace脚本search。 你需要使用./

  <script src="./node_modules/angular/angular.js"></script> <script src="./node_modules/angular-route/angular-route.js"></script> <script src="./build/build.js"></script>