minimonolith 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +3 -2
  2. package/package.json +1 -1
  3. package/src/index.js +25 -0
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { createAPI } from 'lambda-api';
1
+ import createAPI from 'lambda-api';
2
+ import { z } from 'zod';
2
3
  import { serviceHandler } from './src/serviceHandler/serviceHandler.js';
3
4
 
4
- export { createAPI, serviceHandler };
5
+ export { createAPI, serviceHandler, z };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minimonolith",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "scripts": {
package/src/index.js ADDED
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ import createAPI from 'lambda-api';
4
+ import healthCheck from './healthCheck/index.js';
5
+ import { serviceHandler } from './serviceHandler/index.js';
6
+
7
+ const API = createAPI();
8
+
9
+ // Health Check
10
+ API.get('/', async (req, res) => {
11
+ console.log('HEALTH_CHECK ENTERING');
12
+ const response = healthCheck();
13
+ console.log('HEALTH_CHECK SUCCESS');
14
+ return { response };
15
+ });
16
+
17
+ serviceHandler(API, 'todo', 'src');
18
+
19
+ export const handler = async (e, context) => {
20
+ console.log({
21
+ EVENT_PATH: e.path,
22
+ EVENT_METHOD: e.httpMethod,
23
+ });
24
+ return await API.run(e, context);
25
+ };