@stanlemon/app-template 0.3.0 → 0.3.1

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/app.js +5 -5
  2. package/app.test.js +1 -1
  3. package/package.json +1 -1
package/app.js CHANGED
@@ -1,15 +1,17 @@
1
1
  import {
2
2
  createAppServer,
3
3
  asyncJsonHandler as handler,
4
+ createDb,
4
5
  LowDBUserDao,
5
6
  } from "@stanlemon/server-with-auth";
6
7
  import { v4 as uuid } from "uuid";
7
8
 
8
- const dao = new LowDBUserDao();
9
- export const db = dao.getDB();
9
+ export const db = createDb();
10
+ const dao = new LowDBUserDao(db);
11
+
10
12
  db.data.items = db.data.items || [];
11
13
 
12
- const app = createAppServer({
14
+ export const app = createAppServer({
13
15
  webpack: "http://localhost:8080",
14
16
  secure: ["/api/"],
15
17
  dao,
@@ -37,5 +39,3 @@ app.delete(
37
39
  return db.data.items;
38
40
  })
39
41
  );
40
-
41
- export default app;
package/app.test.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @jest-environment node
3
3
  */
4
4
  import request from "supertest";
5
- import app, { db } from "./app.js";
5
+ import { app, db } from "./app.js";
6
6
 
7
7
  describe("/app", () => {
8
8
  afterEach(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stanlemon/app-template",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "A template for creating apps using the webdev package.",
5
5
  "author": "Stan Lemon <stanlemon@users.noreply.github.com>",
6
6
  "license": "MIT",