maxserver 0.0.4 → 0.0.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.
- package/assets/logo.png +0 -0
- package/package.json +1 -5
- package/templates/env +24 -0
- package/templates/gitignore +1 -0
- package/templates/package.json +14 -0
- package/templates/server.js +10 -0
- package/templates/src/greet.js +11 -0
- package/templates/src/greet.schema.js +34 -0
- package/templates/src/hello.js +8 -0
- package/templates/vscode/project.code-snippets.json +18 -0
- package/templates/vscode/tasks.json +23 -0
package/assets/logo.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maxserver",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Node server setup based fastify",
|
|
5
5
|
"author": "Max Matinpalo",
|
|
6
6
|
"type": "module",
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"maxserver": "bin/init.js",
|
|
10
10
|
"maxserver-watcher": "bin/watcher.js"
|
|
11
11
|
},
|
|
12
|
-
"files": [
|
|
13
|
-
"src",
|
|
14
|
-
"README.mde"
|
|
15
|
-
],
|
|
16
12
|
"dependencies": {
|
|
17
13
|
"@fastify/cookie": "^11.0.2",
|
|
18
14
|
"@fastify/cors": "^11.2.0",
|
package/templates/env
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Environment
|
|
2
|
+
NODE_ENV = development
|
|
3
|
+
|
|
4
|
+
# Server
|
|
5
|
+
PORT = 3000
|
|
6
|
+
|
|
7
|
+
# CORS(prod only, ignored in dev)
|
|
8
|
+
# CORS_ORIGIN = https://app.example.com
|
|
9
|
+
|
|
10
|
+
# JWT;
|
|
11
|
+
JWT_SECRET = supersecretkey
|
|
12
|
+
|
|
13
|
+
# MongoDB;
|
|
14
|
+
# MONGODB_URI = mongodb://127.0.0.1:27017/testdb
|
|
15
|
+
|
|
16
|
+
# Static files
|
|
17
|
+
# STATIC_DIR =./ public
|
|
18
|
+
|
|
19
|
+
# API Docs in production
|
|
20
|
+
DOCS = 1
|
|
21
|
+
|
|
22
|
+
# Optional HTTPS(direct TLS, no nginx)
|
|
23
|
+
# TLS_KEY = /etc/ssl / private / server.key
|
|
24
|
+
# TLS_CERT = /etc/ssl / certs / server.crt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node_modules
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const schema = {
|
|
2
|
+
tags: ["Test"],
|
|
3
|
+
summary: "Create greeting",
|
|
4
|
+
description: "Accepts a name and returns a greeting.",
|
|
5
|
+
|
|
6
|
+
body: {
|
|
7
|
+
type: "object",
|
|
8
|
+
required: ["name"],
|
|
9
|
+
properties: {
|
|
10
|
+
name: {
|
|
11
|
+
type: "string",
|
|
12
|
+
example: "Max",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
response: {
|
|
18
|
+
200: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
message: {
|
|
22
|
+
type: "string",
|
|
23
|
+
example: "Hello Max",
|
|
24
|
+
},
|
|
25
|
+
user: {
|
|
26
|
+
type: "object",
|
|
27
|
+
example: {
|
|
28
|
+
userId: "64f1c2e9b1a2c3d4e5f67890",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"handler": {
|
|
3
|
+
"prefix": "handler",
|
|
4
|
+
"body": [
|
|
5
|
+
"// ${1|GET, POST, PUT, PATCH, DELETE|} /$2",
|
|
6
|
+
"",
|
|
7
|
+
"export default async function ${TM_FILENAME_BASE}(req, res) {",
|
|
8
|
+
"",
|
|
9
|
+
"\tconst db = this.mongo.db;",
|
|
10
|
+
"\tconst userId = req.user.userid;",
|
|
11
|
+
"",
|
|
12
|
+
"\t$0",
|
|
13
|
+
"",
|
|
14
|
+
"\treturn res.send({msg: \"${TM_FILENAME_BASE}\"});",
|
|
15
|
+
"}"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Comment task in to autostart server on dir open
|
|
2
|
+
/*
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
{
|
|
6
|
+
"version": "1.0.0",
|
|
7
|
+
"tasks": [
|
|
8
|
+
{
|
|
9
|
+
"label": "devserver 📟",
|
|
10
|
+
"type": "shell",
|
|
11
|
+
"command": "npm run dev",
|
|
12
|
+
"presentation": {
|
|
13
|
+
"reveal": "always",
|
|
14
|
+
"panel": "dedicated"
|
|
15
|
+
},
|
|
16
|
+
"runOptions": {
|
|
17
|
+
"runOn": "folderOpen"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
*/
|