1
我正在使用AWS Lambda构建Web应用程序。我可以在本地运行应用程序,但是当我在AWS上部署应用程序时,应用程序无法加载静态资源。加载资源失败(css/js)AWS Lambda Express节点
app.js
app.use(express.static(__dirname + '/public'));
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname + '/public/index.html'));
});
,在我的index.html,这是我引用的资源
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/gradients.css" rel="stylesheet">
<script src="assets/js/angular.min-1.4.7.js"></script>
我的目录结构是基于
My App/
|app.js
|index.js
|public/
|index.html
|assets/
|css/
|js/
我的研究,让应用坐在一个lambda函数中,不需要特殊的权限来访问这些资源。