Nuxt demo spa
# install dependencies
$ npm install
# serve with hot reload at localhost:3000
$ npm run dev
# build for production and launch server
$ npm run build
$ npm start
# generate static project
$ npm run generate
For detailed explanation on how things work, checkout Nuxt.js docs.
To add a new module to the Store:
- Create a store file, an example can be found with @/store/counter.ts
- Add the module to the store-accesor, in @/utils/store-accesor.ts
- The module can be accesed by any component
import { moduleName } from '@/store';
To add a new route to the api (@/api/admin):
- Create a folder for the module, if doesnt exist. You can guide with the postman definition.
- Create the file with the name of the method. (eg. serverUp, login, etc...);
- Create a index.ts if isn't created, and add an export method:
import { login } from './login';
export {
login
};
- In the index.ts that is located in the root of @/api, import and export the module:
import * as HelperCheck from './admin/helpercheck';
import * as Auth from './admin/auth';
export {
HelperCheck,
Auth
}
- Now it can be accesed via
import { Auth } from '@/api';
...
Auth.login(params);