kopia lustrzana https://github.com/badgen/badgen.net
Add typescript config
rodzic
5a226cc8f2
commit
d6ca0afc5f
|
@ -1,6 +1,6 @@
|
|||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const http = require('http')
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import http from 'http'
|
||||
|
||||
const serve404 = require('../libs/serve-404.js')
|
||||
|
||||
|
@ -9,7 +9,7 @@ const badgeHandlers = fs.readdirSync(__dirname)
|
|||
.map(name => name.replace(/\.js$/, ''))
|
||||
|
||||
module.exports = http.createServer((req, res) => {
|
||||
const handler = badgeHandlers.find(h => req.url.startsWith(`/${h}`))
|
||||
const handler = badgeHandlers.find(h => req.url!.startsWith(`/${h}`))
|
||||
|
||||
if (handler) {
|
||||
return require(path.join(__dirname, handler))(req, res)
|
|
@ -49,6 +49,8 @@
|
|||
"react-dom": "^16.8.6",
|
||||
"standard": "^12.0.1",
|
||||
"supertest": "^4.0.2",
|
||||
"tap": "^12.7.0"
|
||||
"tap": "^12.7.0",
|
||||
"ts-node": "^8.1.0",
|
||||
"typescript": "^3.4.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"target": "esnext",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": true,
|
||||
"outDir": "dist",
|
||||
"baseUrl": ".",
|
||||
"lib": ["esnext"]
|
||||
},
|
||||
"include": [
|
||||
"./src",
|
||||
"./types"
|
||||
]
|
||||
}
|
Ładowanie…
Reference in New Issue