maxserver 0.1.4 → 0.1.5

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/README.md +12 -22
  2. package/TODO.md +4 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,7 +10,6 @@
10
10
  ‼️ **ATTENTION** ‼️ - Not download yet, check out few days later 😉
11
11
  I am simplifying and improving things, that it will work for everyone plugn play.
12
12
 
13
-
14
13
  Ready node server setup based on **Fastify** to speed up backend development.
15
14
  maxserver stands for **maximized simplicity** and **minimum boilerplate**.
16
15
 
@@ -19,22 +18,9 @@ maxserver stands for **maximized simplicity** and **minimum boilerplate**.
19
18
  - **Preconfigures essentials**: jwt auth, cors, helmet
20
19
  - **Auto Connect MongoDB** (optional)
21
20
 
22
-
23
- Apologize builtin devserver watcher atm only for macos.
24
- I should add chokidar for windows, but i hate Windows and extra packages 😃
25
-
26
-
27
21
  <br><br>
28
22
 
29
-
30
23
  ## Install
31
-
32
- ### Setup ready project
33
- ```js
34
- npx maxserver [appname]
35
- ```
36
-
37
- ### Or install as packge
38
24
  ```js
39
25
  npm install maxserver
40
26
  ```
@@ -99,13 +85,15 @@ To auto-register routes, simple add a comment of the form:
99
85
  ...
100
86
 
101
87
  ```js
102
- // GET /example/:id
88
+ // GET /hello
103
89
 
104
- export default async function (req, res) {
90
+ export default async function handler(req, rep) {
91
+
92
+ console.log("GET /hello");
93
+ return {
94
+ message: "Hello world",
95
+ };
105
96
 
106
- const id = req.params.id;
107
- console.log("Example id": id);
108
- return team;
109
97
  }
110
98
  ```
111
99
  <br>
@@ -148,8 +136,8 @@ export default {
148
136
  };
149
137
  ```
150
138
 
151
- **‼️ Important use export default
152
- **
139
+ You will find comlete examples in template folder.
140
+ **‼️ Important use export default**
153
141
 
154
142
  <br>
155
143
 
@@ -204,7 +192,7 @@ Set option **`MONGODB`** your mongodbURI and it will auto-connect at server star
204
192
  | Global | What it is | Why it exists |
205
193
  | :--- | :--- | :--- |
206
194
  | `db` | MongoDB database handle | Use it directly in handlers |
207
- | `oid(id)` | string → `ObjectId` | Avoid importing `ObjectId` everywhere |
195
+ | `oid(id)` | string → `ObjectId` | Saves you from importing everywhere `ObjectId` |
208
196
 
209
197
  ### Example
210
198
 
@@ -256,3 +244,5 @@ In `.vscode/tasks.json`, enable the task with:
256
244
  ### 🤖 AI Assistants
257
245
  Copy **`RULES.md`** into your AI tool as system context,
258
246
  then ask it to generate routes + schemas.
247
+
248
+
package/TODO.md ADDED
@@ -0,0 +1,4 @@
1
+ - get rules.md file for ai (lost atm)
2
+ - add example for db usage
3
+ - unity tests for each config option
4
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxserver",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Node server setup based fastify",
5
5
  "author": "Max Matinpalo",
6
6
  "type": "module",