Added a fix script to the API.
This commit is contained in:
parent
dcbcfaa0b2
commit
e38833bbc0
@ -29,6 +29,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint . --ext mjs",
|
||||
"fix": "npm run lint -- --fix && prettier --write readme.md",
|
||||
"dev": "nodemon --ext mjs",
|
||||
"start": "node --require @std/esm --require dotenv/config server.mjs"
|
||||
},
|
||||
|
||||
@ -4,21 +4,25 @@
|
||||
|
||||
An example GraphQL API using:
|
||||
|
||||
- [koa](https://www.npmjs.com/package/koa)
|
||||
- [graphql-server-koa](https://www.npmjs.com/package/graphql-server-koa)
|
||||
- [apollo-upload-server](https://www.npmjs.com/package/apollo-upload-server)
|
||||
* [koa](https://www.npmjs.com/package/koa)
|
||||
* [graphql-server-koa](https://www.npmjs.com/package/graphql-server-koa)
|
||||
* [apollo-upload-server](https://www.npmjs.com/package/apollo-upload-server)
|
||||
|
||||
## Setup
|
||||
|
||||
1. Install the latest [Node.js](https://nodejs.org) and [npm](https://npmjs.com).
|
||||
1. Install the latest [Node.js](https://nodejs.org) and
|
||||
[npm](https://npmjs.com).
|
||||
2. Duplicate `.env.example` as `.env` and customize.
|
||||
3. With Terminal in the `api` directory run `npm install`.
|
||||
4. Run `npm run dev` for development, or `npm run start` for production.
|
||||
|
||||
Ensure your editor supports:
|
||||
|
||||
- [EditorConfig](http://editorconfig.org).
|
||||
- [ESLint](http://eslint.org), respecting `package.json` config. [Atom](https://atom.io) users install [`linter-eslint`](https://atom.io/packages/linter-eslint) and enable `Fix errors on save`.
|
||||
* [EditorConfig](http://editorconfig.org).
|
||||
* [ESLint](http://eslint.org), respecting `package.json` config.
|
||||
[Atom](https://atom.io) users install
|
||||
[`linter-eslint`](https://atom.io/packages/linter-eslint) and enable `Fix
|
||||
errors on save`.
|
||||
|
||||
## Support
|
||||
|
||||
|
||||
@ -36,7 +36,8 @@ server.listen(process.env.PORT, error => {
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.info(
|
||||
`Serving at http://localhost:${process.env.PORT} in ${process.env
|
||||
.NODE_ENV} mode.`
|
||||
`Serving at http://localhost:${process.env.PORT} in ${
|
||||
process.env.NODE_ENV
|
||||
} mode.`
|
||||
)
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user