import { Auth } from 'pages'
yarn create react-app app-name --typescript
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": [
"src"
]
}
import Vue from 'vue'
import Router from 'vue-router'
import HomePage from './views/index'
Vue.use(Router)
export default new Router({
mode: 'history',
routes: [
{
path: '/',
component: HomePage
},
{
path: '/about',
component: () => import('./views/about.vue')
}
]
})
//+ Vue.js
import Vue from 'vue';
import store from './store/index'
import router from './routers/index'
import App from './App.vue'
Vue.config.productionTip = false
//+ Vue init
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
const express = require('express')
const path = require('path')
const consola = require('consola')
const bodyParser = require('body-parser')
const app = express()
require('dotenv').config()
const PORT : number = parseInt(process.env.PORT) || 3000
const HOST : string = process.env.HOST || 'localhost'
const PATH_TO_CLIENT : string = path.join(__dirname, '..', '..', './dist')
const PATH_TO_HTML : string = path.join(PATH_TO_CLIENT, 'index.html')
const static = express.static(PATH_TO_CLIENT)
app.use(static)
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
app.get('/', (req, res) => {
res.sendFile(PATH_TO_HTML)
})
app.listen(PORT, HOST, () => {
consola.ready({
message: `Server is listening to http://${HOST}:${PORT}`,
badge: true
})
})