Created
August 30, 2021 22:25
-
-
Save dfee/910d17f97ad1b580dcc93f1dec25bda7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import startServer from "verdaccio"; | |
const PORT = 4873 | |
const STORAGE = "./storage"; | |
const CONFIG = { | |
storage: STORAGE, | |
uplinks: { | |
"npmjs": { | |
"url": "https://registry.npmjs.org/" | |
} | |
}, | |
packages: { | |
"@demo/*": { | |
"access": "$all", | |
"publish": "$anonymous", | |
"proxy": "npmjs" | |
}, | |
"**": { | |
"proxy": "npmjs" | |
} | |
}, | |
logs: [ | |
{ | |
"type": "stdout", | |
"format": "pretty", | |
"level": "http" | |
} | |
] | |
} | |
async function onReady(webServer: any): Promise<void> { | |
return new Promise(resolve => { | |
console.log('verdaccio port %s', PORT); | |
webServer.listen(PORT, () => { | |
resolve(webServer); | |
}); | |
}); | |
} | |
export async function doStart(): Promise<void> { | |
startServer(CONFIG, '6000', STORAGE, '1.0.0', 'verdaccio', onReady); | |
} | |
doStart() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment