問題タブ [aws-http-api]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
amazon-web-services - 同じラムダ関数内の他のファイルで使用するエクスポート メソッド - Node.js
リバース プロキシが統合された http API ゲートウェイを使用するラムダでは、API のさまざまなルートを確認する必要があります。今のところ2つindex.js
のファイルがあり、メインファイルにはハンドラーがあります:
私が持っている他のファイルで:
ユーザーが表示された URL/v1/listalltodos
にアクセスしたときmessage "Internal Server Error"
ここで何が問題なのですか?
編集:
ログで関数をエクスポートしようとするたびに、次のように表示されます。
"errorMessage": "SyntaxError: Unexpected token 'export'",
ラムダでメソッドをエクスポートする正しい方法は何ですか?