├── vue.config.js ├── public ├── favicon.ico └── index.html ├── src ├── assets │ └── logo.png ├── http-common.js ├── main.js ├── services │ └── ExplorerService.js ├── router.js ├── App.vue └── components │ ├── ExplorersList.vue │ ├── AddExplorer.vue │ └── Explorer.vue ├── babel.config.js ├── .gitignore ├── README.md └── package.json /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devServer: { 3 | port: 8081 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RodolfoBaume/client-launchx/master/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RodolfoBaume/client-launchx/master/src/assets/logo.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/http-common.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | export default axios.create({ 3 | baseURL: "http://localhost:3000", 4 | headers: { 5 | "Content-type": "application/json" 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import 'bootstrap' 4 | import 'bootstrap/dist/css/bootstrap.min.css' 5 | import router from './router' 6 | createApp(App).use(router).mount('#app') 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-3-crud 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /src/services/ExplorerService.js: -------------------------------------------------------------------------------- 1 | import http from "../http-common"; 2 | 3 | class ExplorerService { 4 | getAll() { 5 | return http.get("/explorers"); 6 | } 7 | get(id) { 8 | return http.get(`/explorers/${id}`); 9 | } 10 | create(data) { 11 | return http.post("/explorers", data); 12 | } 13 | update(id, data) { 14 | return http.put(`/explorers/${id}`, data); 15 | } 16 | delete(id) { 17 | return http.delete(`/explorers/${id}`); 18 | } 19 | } 20 | 21 | export default new ExplorerService(); 22 | -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | import { createWebHistory, createRouter } from "vue-router"; 2 | const routes = [ 3 | { 4 | path: "/", 5 | alias: "/explorers", 6 | name: "explorers", 7 | component: () => import("./components/ExplorersList") 8 | }, 9 | { 10 | path: "/explorer/:id", 11 | name: "explorer-details", 12 | component: () => import("./components/Explorer") 13 | }, 14 | { 15 | path: "/add", 16 | name: "add-explorer", 17 | component: () => import("./components/AddExplorer") 18 | } 19 | ]; 20 | const router = createRouter({ 21 | history: createWebHistory(), 22 | routes, 23 | }); 24 | export default router; 25 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |Selecciona un explorer.
30 |{{ message }}
31 |Selecciona un explorer.
35 |