instaserve 0.0.18 → 0.0.23

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/index.html +6 -0
  2. package/index.mjs +11 -0
  3. package/package.json +1 -1
package/index.html ADDED
@@ -0,0 +1,6 @@
1
+ <!DOCTYPE html>
2
+
3
+ <script>navigator.serviceWorker.register('sw.js')</script>
4
+ <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css'>
5
+
6
+ <div class='bg-yellow-200'>hello</div>
package/index.mjs CHANGED
@@ -6,6 +6,8 @@ import { resolve } from 'node:path'
6
6
 
7
7
  const routesfile = resolve('routes.mjs')
8
8
  const routesurl = pathToFileURL(routesfile).href
9
+ const indexfile = resolve('index.html')
10
+
9
11
  console.log(routesfile, routesurl)
10
12
 
11
13
  if (!fs.existsSync(routesfile)) {
@@ -15,6 +17,15 @@ if (!fs.existsSync(routesfile)) {
15
17
  'tables': name => ([k, v]) => k.match(name + ':')
16
18
  }`)
17
19
  }
20
+ if (!fs.existsSync(indexfile)) {
21
+ fs.writeFileSync(indexfile, `<!DOCTYPE html>
22
+
23
+ <script>navigator.serviceWorker.register('sw.js')</script>
24
+ <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css'>
25
+
26
+ <div class='bg-yellow-200'>hello</div>`)
27
+ }
28
+
18
29
  const routes = (await import(routesurl)).default
19
30
  routes['/sw.js'] = e => {
20
31
  e.s.writeHead(201, { 'Content-Type': 'application/javascript' })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instaserve",
3
- "version": "0.0.18",
3
+ "version": "0.0.23",
4
4
  "description": "",
5
5
  "main": "index.mjs",
6
6
  "bin": "./index.mjs"