Skip to content

Commit

Permalink
10007: WIP trying to not start serverless.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Rogers committed Dec 7, 2023
1 parent 3c2adaa commit e1770a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .cognito/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"secretAccessKey": "local"
},
"region": "local",
"endpoint": "http://localhost:9997"
"endpoint": "http://localhost:9845"
},
"TokenConfig": {
"IssuerDomain": "http://localhost:9229"
Expand All @@ -15,7 +15,7 @@
"PostAuthentication": "cognito-triggers-sls-dev-PostAuthentication_Authentication"
},
"LambdaConfig": {
"endpoint": "http://localhost:9997"
"endpoint": "http://localhost:9845"
},
"UserPoolDefaults": {
"UsernameAttributes": [
Expand Down
1 change: 0 additions & 1 deletion run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ else
fi

echo "Starting local lambda for cognito triggers"
npm run start:cognito-triggers-local &
echo "Starting cognito-local"
CODE=123456 npx cognito-local &

Expand Down
16 changes: 16 additions & 0 deletions web-api/src/app-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { server as WebSocketServer } from 'websocket';
import { Writable } from 'stream';
import { connectLambda } from './lambdas/notifications/connectLambda';
import { disconnectLambda } from './lambdas/notifications/disconnectLambda';
import { handler } from '../terraform/template/lambdas/cognito-triggers';
import { app as localApiApp } from './app';
import { app as localPublicApiApp } from './app-public';
import { processStreamRecordsLambda } from './lambdas/streams/processStreamRecordsLambda';
Expand All @@ -22,6 +23,21 @@ const localPublicApiPort = 5000;
localPublicApiApp.listen(localPublicApiPort);
console.log(`Listening on http://localhost:${localPublicApiPort}`);

// ************************ cognito-junk *********************************
const cognitoApp = express();
cognitoApp.use(express.json({ limit: '1200kb' }));
cognitoApp.listen(9845);
cognitoApp.use('*', (req, res) => {
console.log('Cognito req.url', req.url);
console.log('Cognito req.method', req.method);
console.log('Cognito req.headers', req.headers);
console.log('Cognito req.body', req.body);
res.send();
});
cognitoApp.post('/', (req, res) => {
res.send(handler(req));
});

// ************************ streams-local *********************************
const config = {
credentials: {
Expand Down

0 comments on commit e1770a7

Please sign in to comment.