https://github.com/trco/koa-vue
Koa & Vue
https://github.com/trco/koa-vue
Last synced: 5 months ago
JSON representation
Koa & Vue
- Host: GitHub
- URL: https://github.com/trco/koa-vue
- Owner: trco
- Created: 2019-06-18T20:01:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T00:52:04.000Z (over 3 years ago)
- Last Synced: 2025-04-02T21:35:09.187Z (about 1 year ago)
- Language: JavaScript
- Size: 1.12 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 35
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
===========
Koa & Vue
===========
Koa backend & Vue frontend
Run
===
Run docker and visit http://localhost:8080::
$ docker-compose up
How to build it from scratch?
=============================
1. Create project folder::
$ mkdir koa-vue
$ cd koa-vue
2. Create Koa backend app, install dependencies::
$ koa2 back
$ cd back
$ npm install
3. Change default port from ``3000`` to ``8000`` in ``bin/www``.
4. Install ``koa2-cors``::
$ npm install koa2-cors --save
5. Add ``koa2-cors`` to app.js::
const cors = require('koa2-cors')
app.use(cors());
6. Install ``vue client``::
$ npm install -g @vue/cli
7. Create Vue frontend app in project folder, install dependencies::
$ vue create front
8. Fetch data from Koa backend through "http://localhost:8000/" inside .vue files.
9. Create separate ``Dockerfile`` in back and front apps and ``docker-compose.yml`` in project folder.