front-end almost done | started back-end

This commit is contained in:
Amir Mohamadi
2020-11-23 19:39:26 +03:30
parent 95149f0e72
commit 80a7abafb7
191 changed files with 60163 additions and 950 deletions
-8
View File
@@ -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).
+11
View File
@@ -0,0 +1,11 @@
export default function ({route, redirect, error}) {
///////////// redirect to default local
if (route.path === '/') return redirect('/fa')
///////////// local check
const lang = ['fa', 'en']
const isLocal = lang.includes(route.params.lang)
const isAdmin = route.path.includes('/admin')
if (isLocal || isAdmin) return null
else error({statusCode: 404, message: 'Page Not Found'})
}