Skip to content

Instantly share code, notes, and snippets.

View ea2305's full-sized avatar
👨‍💻
_coding

Elihu Cruz ea2305

👨‍💻
_coding
View GitHub Profile
@ea2305
ea2305 / .js
Last active May 7, 2020 16:28
example ssr - vue app update
// app.vue
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
</template>
<script>
@ea2305
ea2305 / .js
Created May 7, 2020 16:17
example ssr - update main app
// src/main.js
import Vue from 'vue'
import App from './App.vue'
import VueMeta from 'vue-meta'
Vue.config.productionTip = false
Vue.use(VueMeta, {
// optional pluginOptions
@ea2305
ea2305 / .js
Last active May 7, 2020 16:16
example ssr - vue config pre-render
// vue.config.js
module.exports = {
pluginOptions: {
prerenderSpa: {
registry: undefined,
renderRoutes: [
'/'
],
useRenderEvent: true,
@ea2305
ea2305 / .sh
Last active May 7, 2020 18:22
Vue pre-render commands
# prerender tool
# add an extra module to our vue project to be able to generate the meta tags.
vue add prerender-spa
# meta plugin
# install a complement to inject header attributes on our vue app.
npm i vue-meta --save
'use strict'
const Env = use('Env')
const Logger = use('Logger')
class AuthController {
/**
* Login user controller
* @param {Object} request : HTTP Request
* @param {Object} response : HTTP Request
# Crear controlador
adonis make:controller Auth
// Ejecutamos pruebas
adonis test
'use strict'
// Importamos test y trait para poder realizar consultas a la api
const { test, trait } = use('Test/Suite')('User Login')
trait('Test/ApiClient')
// Models
const User = use('App/Models/User')
// user template
# Creamos prueba funcional
adonis make:test UserLogin --unit
adonis install @adonisjs/vow