Skip to content

Commit 5445656

Browse files
author
hirsch88
committed
Add new stetup script
1 parent 489d0e3 commit 5445656

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ A delightful way to building a RESTful API with NodeJs & TypeScript.
2626
### Installing
2727
* `fork` this repo
2828
* `clone` your fork
29-
* `yarn install` to install all dependencies and typings
30-
* `cp .env.example .env` to copy the example .env file.
31-
* Create new database. You will find the name in the .env file.
32-
* `npm run db:migrate` to create the schema
33-
* `npm run db:seed` to insert some test data
34-
* `npm run serve` to start the dev server in another tab
29+
* `cp .env.example .env` to copy the example .env file and enter your database connection
30+
* Run `npm run setup` or enter the following commands manually:
31+
* `yarn install` to install all dependencies and typings.
32+
* Create new database. You will find the name in the .env file.
33+
* `npm run db:migrate` to create the schema.
34+
* `npm run db:seed` to insert some test data.
35+
* `npm run serve` to start the application.
3536

3637
### Running the app
3738
After you have installed all dependencies you can run the app.
@@ -106,7 +107,7 @@ created file!!**
106107
Just set a breakpoint and hit `F5` in your Visual Studio Code.
107108

108109
## API Routes
109-
The route prefix is `/api/v1` by default, but you can change this in the .env file.
110+
The route prefix is `/api` by default, but you can change this in the .env file.
110111

111112
| Route | Description |
112113
| ----------- | ----------- |

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
"scripts": {
77
"banner": "./node_modules/.bin/ts-node --fast ./src/console/lib/banner.ts",
88
"pretest": "./node_modules/.bin/tslint -c ./tslint.json -t stylish './test/unit/**/*.ts'",
9-
"test": "npm run banner test && NODE_ENV=test ./node_modules/.bin/jest ./test/unit",
109
"test:pretty": "npm run test -- --verbose",
1110
"test:coverage": "npm run test -- --coverage",
1211
"pretest:black-box": "./node_modules/.bin/tslint -c ./tslint.json -t stylish './test/black-box/**/*.ts'",
1312
"test:black-box": "npm run banner test && NODE_ENV=test ./node_modules/.bin/jest ./test/black-box -i",
1413
"test:black-box:pretty": "npm run test:black-box -- --verbose",
1514
"lint": "./node_modules/.bin/tslint -c ./tslint.json -p tsconfig.json 'src/**/*.ts' --format stylish",
16-
"build": "npm run banner build && npm run lint && npm run clean:dist && npm run transpile && npm run copy:assets",
1715
"transpile": "./node_modules/.bin/tsc",
1816
"clean:dist": "./node_modules/.bin/rimraf ./dist",
1917
"copy:assets": "npm run copy:swagger && npm run copy:public",
@@ -26,7 +24,10 @@
2624
"console": "./node_modules/.bin/ts-node --fast ./src/console/commander.ts",
2725
"console:dev": "./node_modules/.bin/ts-node ./src/console/commander.ts",
2826
"console:help": "./node_modules/.bin/ts-node --fast ./src/console/commander.ts --help",
27+
"setup": "yarn install && npm run db:migrate && npm run db:seed",
2928
"serve": "npm run banner serve && ./node_modules/.bin/nodemon --watch 'src/**/*.ts' --watch 'src/**/*.json' --watch '.env'",
29+
"test": "npm run banner test && NODE_ENV=test ./node_modules/.bin/jest ./test/unit",
30+
"build": "npm run banner build && npm run lint && npm run clean:dist && npm run transpile && npm run copy:assets",
3031
"start": "node dist/app.js"
3132
},
3233
"repository": "git+ssh://git@github.com/w3tec/express-typescript-boilerplate.git",

0 commit comments

Comments
 (0)