Repository navigation
Expand file tree
/
Copy pathnodejs
More file actions
78 lines (64 loc) · 2.5 KB
/
Copy pathnodejs
File metadata and controls
78 lines (64 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
doc nodejs pour typescript:
bien préciser pour typescript pour isntaller chaque module
tutorial install nodejs with typescript for backend :
https://www.digitalocean.com/community/tutorials/setting-up-a-node-project-with-typescript-fr
globalThis error in Typescript, how to solve :
npm i typescript@2.7.2 --save
installer nodemon pour typescript pour ne pas avoir à relancer le serveur et le script pour le lancer :
https://futurestud.io/tutorials/typescript-use-nodemon-to-restart-your-server-on-changes
"start": "nodemon --watch './**/*.ts' --exec 'ts-node' src/app.ts"
configure webstorm pour pas souligner tout le code en rouge :
https://www.jetbrains.com/help/webstorm/developing-node-js-applications.html#ws_node_configure_local_node_interpreter
https://stackoverflow.com/questions/56235533/tslint-how-to-avoid-that-all-my-code-underlined-in-red
squelize pour typescript :
https://sequelize.org/master/manual/typescript.html
https://sequelize.org/master/manual/migrations.html
pour impoter la database :
https://github.com/sequelize/sequelize-auto
790 node app.js
791 touch socket.js
792 cd ..
793 node start
794 node app.js
795 touch sql.hs
796 touch derniere_date.ejs
797 mysql -u phpmyadmin -pClementine1011%
798 node app.js
799 node app.js
800 mkdir node_project
801 cd node_project
802 npm init
803 npm init -y
804 npm install -D typescript@3.3.3
805 npm install -D tslint@5.12.1
806 npm install -S express@4.16.4
807 npm install -D @types/express@4.16.1
808 cd
809 touch tsconfig.json
810 vi tsconfig.json
811 /node_modules/.bin/tslint --init
812 cd node_project/
813 /node_modules/.bin/tslint --init
814 ./node_modules/.bin/tslint --init
815 mkdir src
816 touch src/app.ts
817 npm start
818 npm install @types/node
819 npm start
npm i typescript@2.7.2 --save
npm install nodemon
npm i -D nodemon ts-node
npm install --save sequelize
npm install sequelize reflect-metadata sequelize-typescript
npm install --save mysql2
npm install --save-dev @types/node @types/validator
sudo npm install -g sequelize-cli
fichier configuration /config/config.json remplir mot de passe bdd etc ... :
sequelize init
vérifier la connection à sequelize et a push les mdofication de la db:
sequelize db:migrate
create model :
npx sequelize-cli model:generate --name User --attributes firstName:string,lastName:string,email:string
sudo npm install -g sequelize-cli-typescript
npm install -g mysql
sudo npm install -g sequelize-auto-models