Boilerplate for your modern Vue.js project with Vue Router and Bootstrap using :
- TypeScript
- Vue.js
- Vue Router
- Bootstrap
if you don't have clone the repository yet, you can clone it by running one of the following commands:
git clone https://github.com/IweZix/vue-boilerplate.git
git clone https://github.com/IweZix/vue-boilerplate.git name-of-your-project
if you have already cloned the repository, you can remove the
.git
folder by running the following command:
rm -rf .git
then you can install the dependencies by running the following commands:
cd name-of-your-project
then you can install the dependencies by running the following commands:
npm install
you can run the following command to start the development server:
npm run dev
Check types
npm run type-check
Check lint errors
npm run lint
Format files
npm run format
I recommend using Axios for making requests and using Promises.
You can configure the API's base URL in the vite.config.ts
file. By default, it is set to http://localhost:3000
.
If you want to do some requests, you can use the following code:
// if your URL is http://localhost:3000/users/userAScending
// replace http://localhost:3000 by /api
axios.get('/api/users/userAScending')
.then((response) => {
// code to execute if the request is successful
})
.catch((error) => {
// code to execute if the request fails
});