@frozencrow/create-api 0.1.4 → 0.2.0
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.
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -22,7 +22,8 @@ Configuration uses the Feathers config module (no `.env` files):
|
|
|
22
22
|
was scaffolded with a strong `authentication.secret` here.
|
|
23
23
|
- `config/test.json` — used when `NODE_ENV=test`.
|
|
24
24
|
- `config/custom-environment-variables.json` — maps env vars (`AUTH_SECRET`,
|
|
25
|
-
`MONGODB_URI`, `PORT`, …) onto config for production.
|
|
25
|
+
`MONGODB_URI`, `PORT`, `ORIGINS`, …) onto config for production. Note
|
|
26
|
+
`ORIGINS` is JSON-formatted, e.g. `ORIGINS=["https://app.example.com"]`.
|
|
26
27
|
|
|
27
28
|
Generate a fresh secret any time with `npm run secret -- --write` (updates
|
|
28
29
|
`config/local.json`), or set `AUTH_SECRET` in the environment for production.
|
|
@@ -65,5 +66,6 @@ npm test # needs a MongoDB on localhost:27017
|
|
|
65
66
|
## Production
|
|
66
67
|
|
|
67
68
|
- Set a strong `AUTH_SECRET` (the app refuses to boot in production without one).
|
|
68
|
-
- Set `ORIGINS` to your allowed browser origins.
|
|
69
|
+
- Set `ORIGINS` to your allowed browser origins (JSON array, e.g.
|
|
70
|
+
`ORIGINS=["https://app.example.com"]`).
|
|
69
71
|
- `npm run compile && npm start`, or build the Docker image.
|
|
@@ -11,7 +11,8 @@ services:
|
|
|
11
11
|
- MONGODB_URI=mongodb://mongodb:27017/my-api
|
|
12
12
|
- MAIL_HOST=smtp4dev
|
|
13
13
|
- MAIL_PORT=25
|
|
14
|
-
-
|
|
14
|
+
# ORIGINS is JSON-formatted (see config/custom-environment-variables.json)
|
|
15
|
+
- ORIGINS=["http://localhost:5173"]
|
|
15
16
|
# Override with a strong value in any non-local environment.
|
|
16
17
|
- AUTH_SECRET=dev-only-secret-change-me-32-chars!!
|
|
17
18
|
depends_on:
|
package/template/package.json
CHANGED
|
@@ -26,4 +26,11 @@ describe('Feathers application tests', () => {
|
|
|
26
26
|
assert.strictEqual(data.code, 404)
|
|
27
27
|
assert.strictEqual(data.name, 'NotFound')
|
|
28
28
|
})
|
|
29
|
+
|
|
30
|
+
it('attaches socket.io even with seeding enabled', async () => {
|
|
31
|
+
// Regression test: the core's seed setup hook must call next(), or the
|
|
32
|
+
// setup chain stops and @feathersjs/socketio never attaches to the HTTP
|
|
33
|
+
// server (this config runs with seed: true).
|
|
34
|
+
assert.ok((app as any).io, 'app.io should be set after listen()')
|
|
35
|
+
})
|
|
29
36
|
})
|