Our Initial NodeJS/TypeScript setup¶
Initial project creation¶
We use NPM's support for custom project initialization. The source code for our initializer is available at Github.
Initialize the project files:¶
cd ~/git/hangovergames
npm init @heusalagroup/backend ./YOUR-PROJECT-NAME
- Select package name as
@hangovergames/YOUR-PROJECT-NAME
- Choose a license as MIT License
Build the project:¶
npm run build
Add built project file to git:
git add -f ./dist/YOUR-PROJECT-NAME.js
git commit -m 'Added compiled project bundle'
Push the git repository to Github¶
Create a git repository using Github and don't select any customizations.
git remote add origin git@github.com:hangovergames/YOUR-PROJECT-NAME.git
git push -u origin main
Start the server:¶
npm run start-prod
Test if the system runs¶
Then open http://localhost:3000 in the browser.
You should see a JSON response.
Start development¶
The main controller code is in the file ./src/controllers/BackendController.ts
.