This project has been generated using the aws-nodejs-typescript
template from the Serverless framework.
Depending on your preferred package manager, follow the instructions below to deploy your project.
Requirements: NodeJS
lts/fermium (v.14.15.0)
. If you're using nvm, runnvm use
to ensure you're using the same Node version in local and in your lambda's runtime.
- Run
npm i
to install the project dependencies
- Run
yarn
to install the project dependencies
Run npx serverless offline start
, the api is reachable under http://localhost:3000/dev/find_views
Test with curl -X POST -H "Content-Type: application/json" -d @example.json http://localhost:3000/dev/find_views?n=3
The endpoint is accessable trough a POST
request, where the body is expected to be the json mesh format.
Optionaly the query parameter 'n' can be specified on the required amount of view spots, if left empty it will return all suitable view points.
{
nodes: [
{id: <node_id>, x: <x_pos>, y: <y_pos>},
...
],
elements: [
{id: <element_id>, nodes: [<node_id_1>, <node_id_2>, <node_id_3>]},
...
],
values: [
{element_id: <element_id>, value: <height>},
...
]
}