An updated Express app to connect to Docker locally
const express = require('express'); | |
const AWS = require('aws-sdk'); | |
AWS.config.update({ | |
region: 'us-west-2', | |
endpoint: 'http://docker.for.mac.host.internal:8888' | |
}); | |
const dc = new AWS.DynamoDB.DocumentClient(); | |
const app = express(); | |
const table = "apptable"; | |
app.get('/test', (req, res) => { | |
let params = { | |
TableName: table | |
}; | |
dc.scan(params).promise() | |
.then((response) => { | |
res.status(200).send(response); | |
}) | |
.catch((err) => { | |
res.status(500).send(err); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment