Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const { Pool, Client } = require('pg');
- const client = new Client({
- user: 'postgres',
- host: '10.0.0.62',
- database: '<REDACTED>',
- password: '<REDACTED>',
- port: 5432,
- ssl: true
- });
- client.connect();
- client.query('SELECT NOW()', (err, res) => {
- console.log(err, res)
- client.end()
- const response = {
- statusCode: 200,
- body: JSON.stringify({
- message: res,
- input: event,
- }),
- };
- //callback(null, response);
- });
- // Use this code if you don't use the http event with the LAMBDA-PROXY integration
- // callback(null, { message: 'Go Serverless v1.0! Your function executed successfully!', event });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement