use npm -> update readme

This commit is contained in:
Adrien Marquès 2018-10-22 17:40:56 +02:00
parent 6b53a6358f
commit da6edab899
3 changed files with 40 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/node_modules /node_modules
/package-lock.json
/dist /dist
*.js *.js

View File

@ -5,18 +5,29 @@ Simple REST API mixer as a service. A minimal service will be deployed on your l
### Launch the project ### Launch the project
##### 1. Transpile sources ##### Prerequisites
> You need to install `typescript`, it will automatically install its compiler (_i.e. tsc_) into your environment path. You can easily install it globally with `npm -g i typescript`. You need `node` and `npm` installed.
##### 1. Install dependencies
Go into the project's folder and run :
```bash
$ npm i
```
##### 2. Transpile sources
Then launch the following command inside the project's folder : Then launch the following command inside the project's folder :
```bash ```bash
$ tsc $ npm run build
``` ```
All source files of the `src/` folder will be transpiled into the `dist/` folder. All source files of the `src/` folder will be transpiled into the `dist/` folder.
##### 2. Launch server > It is also possible to watch the typescript while developping and modifying files with the command `npm run watch`.
##### 3. Launch server
> You need to have `node` installed. > You need to have `node` installed.

24
package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "api-mixer.js",
"version": "1.0.0",
"author": "xdrm-brackets | SeekDaSky",
"license": "MIT",
"description": "Simple REST API mixer as a service.",
"repository": {
"type": "git",
"url": "https://git.xdrm.io/MTI/api-mixer.js"
},
"main": "dist/main.js",
"dependencies": {
"request": "^2.88.0"
},
"devDependencies": {
"@types/node": "^10.12.0",
"typescript": "^3.1.3"
},
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"start": "node dist/main.js"
}
}