File tree Expand file tree Collapse file tree 3 files changed +130
-0
lines changed Expand file tree Collapse file tree 3 files changed +130
-0
lines changed Original file line number Diff line number Diff line change @@ -50,3 +50,84 @@ modules.order
50
50
Module.symvers
51
51
Mkfile.old
52
52
dkms.conf
53
+
54
+ # Logs
55
+ logs
56
+ * .log
57
+ npm-debug.log *
58
+ yarn-debug.log *
59
+ yarn-error.log *
60
+
61
+ # Runtime data
62
+ pids
63
+ * .pid
64
+ * .seed
65
+ * .pid.lock
66
+
67
+ # Directory for instrumented libs generated by jscoverage/JSCover
68
+ lib-cov
69
+
70
+ # Coverage directory used by tools like istanbul
71
+ coverage
72
+
73
+ # nyc test coverage
74
+ .nyc_output
75
+
76
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
77
+ .grunt
78
+
79
+ # Bower dependency directory (https://bower.io/)
80
+ bower_components
81
+
82
+ # node-waf configuration
83
+ .lock-wscript
84
+
85
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
86
+ build /Release
87
+
88
+ # Dependency directories
89
+ node_modules /
90
+ jspm_packages /
91
+
92
+ # TypeScript v1 declaration files
93
+ typings /
94
+
95
+ # Optional npm cache directory
96
+ .npm
97
+
98
+ # Optional eslint cache
99
+ .eslintcache
100
+
101
+ # Optional REPL history
102
+ .node_repl_history
103
+
104
+ # Output of 'npm pack'
105
+ * .tgz
106
+
107
+ # Yarn Integrity file
108
+ .yarn-integrity
109
+
110
+ # dotenv environment variables file
111
+ .env
112
+ .env.test
113
+
114
+ # parcel-bundler cache (https://parceljs.org/)
115
+ .cache
116
+
117
+ # next.js build output
118
+ .next
119
+
120
+ # nuxt.js build output
121
+ .nuxt
122
+
123
+ # vuepress build output
124
+ .vuepress /dist
125
+
126
+ # Serverless directories
127
+ .serverless /
128
+
129
+ # FuseBox cache
130
+ .fusebox /
131
+
132
+ # DynamoDB Local files
133
+ .dynamodb /
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " zlibserver" ,
3
+ "author" : " Eduard Lebedyuk" ,
4
+ "version" : " 0.0.1" ,
5
+ "description" : " Sample zlib compress server" ,
6
+ "repository" : {
7
+ "type" : " git" ,
8
+ "url" : " https://github.com/intersystems-ru/zlibisc.git"
9
+ },
10
+ "keywords" : [
11
+ " intersystems" ,
12
+ " cache" ,
13
+ " intersystems iris"
14
+ ],
15
+ "dependencies" : {
16
+ "express" : " *"
17
+ },
18
+ "license" : " MIT"
19
+ }
Original file line number Diff line number Diff line change
1
+ //zlibserver.js
2
+ const express = require ( 'express' ) ;
3
+ const zlib = require ( 'zlib' ) ;
4
+
5
+ var app = express ( ) ;
6
+
7
+ app . get ( '/zlibapi/:text' , function ( req , res ) {
8
+ res . type ( 'application/json' ) ;
9
+
10
+ var text = req . params . text ;
11
+
12
+ try {
13
+ zlib . deflate ( text , ( err , buffer ) => {
14
+ if ( ! err ) {
15
+ res . status ( 200 ) . send ( buffer . toString ( 'binary' ) ) ;
16
+ } else {
17
+ res . status ( 500 ) . json ( { "error" : err . message } ) ;
18
+ // handle error
19
+ }
20
+ } ) ;
21
+ }
22
+ catch ( err ) {
23
+ res . status ( 500 ) . json ( { "error" : err . message } ) ;
24
+ return ;
25
+ }
26
+
27
+ } ) ;
28
+ app . listen ( 3000 , function ( ) {
29
+ console . log ( "zlibserver is ready captain." ) ;
30
+ } ) ;
You can’t perform that action at this time.
0 commit comments