Skip to content
Snippets Groups Projects
Commit bc9b296c authored by Simon Döring's avatar Simon Döring
Browse files

Add typescript compiler to dependencies

parent b732dd1b
No related branches found
No related tags found
No related merge requests found
......@@ -16,8 +16,11 @@ One can also refresh the token for a given slot or simply deactivate it.
## Compiling and Running the Server
The camera server is written in typescript, a superset of javascript. That means that is has to be compiled before being able to start.
To compile the code, install the typescript compiler using npm `npm install -g typescript` or apt `apt install node-typescript`.
Navigate into the `camera-server` folder and run `tsc`. This will compile the files into a newly created folder `dist`.
To compile the code, install all dependencies, including the typescript compiler.
This can be done by running `npm install` in the `camera-server` folder.
Then run `npm run build` in the same folder. This will compile the files into a newly created folder `dist`.
If you want to compile the code into a single file, run `npm run build-single-file` instead.
Once the code is compiled, the server can be started with `node server.js` in the `dist` folder.
......
......@@ -29,9 +29,9 @@
}
},
"@types/node": {
"version": "14.14.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.12.tgz",
"integrity": "sha512-ASH8OPHMNlkdjrEdmoILmzFfsJICvhBsFfAum4aKZ/9U4B6M6tTmTPh+f3ttWdD74CEGV5XvXWkbyfSdXaTd7g=="
"version": "14.14.20",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.20.tgz",
"integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A=="
},
"@types/socket.io": {
"version": "2.1.12",
......@@ -180,6 +180,12 @@
"debug": "~4.1.0"
}
},
"typescript": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz",
"integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==",
"dev": true
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
......
......@@ -3,12 +3,15 @@
"version": "1.0.0",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "npx tsc",
"build-single-file": "npx tsc -m amd --outfile dist/server.js"
},
"dependencies": {
"socket.io": "^3.0.4"
},
"devDependencies": {
"@types/socket.io": "^2.1.12"
"@types/node": "^14.14.20",
"@types/socket.io": "^2.1.12",
"typescript": "^4.1.3"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment