Follow these steps to set up and configure the application to run it locally ๐
Make sure you have the following softwares installed on your system:
Start by cloning the repository ๐
git clone https://github.com/azevedev/api-node-pilab
Navigate to the root directory and install the project dependencies using Yarn:
cd api-node-pilab
yarn install
This will download โฌ and install all the required dependencies specified in the package.json
file.
To build the TypeScript code into JavaScript, run the following command ๐
yarn build
This will compile the TypeScript code and generate the JavaScript output in the designated directory (e.g., dist
๐)
You'll need a database to use the application. I've added a seed file (โ๐ค) that will populate your database to simplify the process.
In order to use the migrations, just type โจ
yarn knex:migrate
This command will create the database and run the migrations. After that is done, just type:
yarn knex:seed
Once the build process is complete and you created the database, you can start the application locally using the following command:
yarn start
This will run the compiled TypeScript code inside dist
on your local machine using Node.
To use the TypeScript files on your server, meaning run it as a dev ๐ป, use:
yarn dev
And that's it! ๐๐
You can test the application on http://localhost:3333/api/v1
. Make sure it's the correct port (it'll be displayed on your console).
Feel free to explore and customize the code according to your requirements. Cheers! ๐