mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
Point package.json:bin at cli.js
This commit is contained in:
parent
fd86710fdb
commit
f6ca61233c
3 changed files with 8 additions and 2 deletions
1
cli.js
Normal file
1
cli.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
require('./lib/index').start()
|
||||
|
|
@ -3,10 +3,11 @@
|
|||
"version": "5.1.3",
|
||||
"description": "An Express server and middleware for querying the MusicBrainz API using GraphQL.",
|
||||
"main": "lib/index.js",
|
||||
"bin": "lib/index.js",
|
||||
"bin": "cli.js",
|
||||
"files": [
|
||||
"lib",
|
||||
"scripts",
|
||||
"cli.js",
|
||||
"Procfile",
|
||||
"schema.json",
|
||||
"yarn.lock"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ const middleware = ({
|
|||
|
||||
export default middleware
|
||||
|
||||
if (require.main === module) {
|
||||
export function start () {
|
||||
require('dotenv').config({ silent: true })
|
||||
const app = express()
|
||||
const port = process.env.PORT || 3000
|
||||
|
|
@ -41,3 +41,7 @@ if (require.main === module) {
|
|||
app.listen(port)
|
||||
console.log(`Listening on port ${port}.`)
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
start()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue