diff --git a/README.md b/README.md index fcb7273..91de248 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # full-skies Ce projet a pour but d'exploiter [l'API Le Système Solaire](https://api.le-systeme-solaire.net/) et de proposer une interface simple pour selectionner des favoris. +Il a été conçu lors d'un module d'apprentissage de Nuxt/Vue à MyDigitalSchool. - [Dependencies](#dependencies) - [How to install](#how-to-install) ## Dependencies diff --git a/assets/README.md b/assets/README.md deleted file mode 100644 index 34766f9..0000000 --- a/assets/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# ASSETS - -**This directory is not required, you can delete it if you don't want to use it.** - -This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). diff --git a/layouts/README.md b/layouts/README.md deleted file mode 100644 index cad1ad5..0000000 --- a/layouts/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# LAYOUTS - -**This directory is not required, you can delete it if you don't want to use it.** - -This directory contains your Application Layouts. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). diff --git a/layouts/error.vue b/layouts/error.vue new file mode 100644 index 0000000..673f5ea --- /dev/null +++ b/layouts/error.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/middleware/README.md b/middleware/README.md deleted file mode 100644 index 01595de..0000000 --- a/middleware/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# MIDDLEWARE - -**This directory is not required, you can delete it if you don't want to use it.** - -This directory contains your application middleware. -Middleware let you define custom functions that can be run before rendering either a page or a group of pages. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). diff --git a/pages/README.md b/pages/README.md deleted file mode 100644 index 1d5d48b..0000000 --- a/pages/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# PAGES - -This directory contains your Application Views and Routes. -The framework reads all the `*.vue` files inside this directory and creates the router of your application. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). diff --git a/pages/astres/_slug.vue b/pages/astres/_slug.vue index d3349b0..61f5b62 100644 --- a/pages/astres/_slug.vue +++ b/pages/astres/_slug.vue @@ -53,22 +53,14 @@ import { fetchCelestial } from '@/api/le-systeme-solaire' export default { name: 'Celestial', - data () { - return { - celestial: false + async asyncData ({ params, error }) { + const slug = params.slug + try { + const celestial = await fetchCelestial(slug) + return { celestial } + } catch (err) { + error(err) } - }, - - mounted () { - // Fetches from API... - fetchCelestial(this.$route.params.slug) - .then((res) => { - this.celestial = res - return this.celestial - }) - // .catch((err) => { - // console.error(err) - // }) } } diff --git a/plugins/README.md b/plugins/README.md deleted file mode 100644 index ca1f9d8..0000000 --- a/plugins/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# PLUGINS - -**This directory is not required, you can delete it if you don't want to use it.** - -This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). diff --git a/static/README.md b/static/README.md deleted file mode 100644 index cf00435..0000000 --- a/static/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# STATIC - -**This directory is not required, you can delete it if you don't want to use it.** - -This directory contains your static files. -Each file inside this directory is mapped to `/`. -Thus you'd want to delete this README.md before deploying to production. - -Example: `/static/robots.txt` is mapped as `/robots.txt`. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). diff --git a/test/Logo.spec.js b/test/Logo.spec.js deleted file mode 100644 index c5fbeeb..0000000 --- a/test/Logo.spec.js +++ /dev/null @@ -1,9 +0,0 @@ -import { mount } from '@vue/test-utils' -import Logo from '@/components/Logo.vue' - -describe('Logo', () => { - test('is a Vue instance', () => { - const wrapper = mount(Logo) - expect(wrapper.vm).toBeTruthy() - }) -})