-
Notifications
You must be signed in to change notification settings - Fork 0
Installation & Execution
(Co.Koa has only been tested with Linux environments. Support for other OS environments is purely speculative.)
To install a local instance of Co.Koa, you will need to install the co-koa-cli from the NPM repository. If you do not as yet have NPM and/or NodeJS installed, please visit: https://www.npmjs.com/ and follow the relevant instructions.
-
To install co-koa-cli, enter
npm i co-koa-cli -g
into your terminal -
Create a directory where you would like your Co.Koa instance to live and ensure you have permission to read, write and execute within it.
-
In terminal, navigate to your project's directory folder and type co-koa-cli --create
-
the interface will request an NPM-friendly name for your project (npm advises names in lower case with no special characters), a repository URI and an "author" name. You can leave these names blank for now if you like, they merely update the respective fields in the project's package.json (which can be altered at a later time)
-
Now type
npm i
to install Co.Koa's dependencies. -
Your project is installed! You'll need to wire it up with a mongoose database to finish things off. Visit https://www.mongodb.com/ for instructions.
-
in you project, navigate to
\config\config.json
and set the MongoDB_URI accordingly (most likely, the default config URI will work while testing things out on a local machine). -
Co.Koa is installed!
(Note it is possible to install Co.Koa via an npx call within a directory, however, your local package.json will be overwritten by the CLI in the process)
-
Ensure you have a MongoDB instance running in the background and that it's setup to start with your development environment.
-
type
npm run cokoa
in the root directory of your Co.Koa project. Optionally, should you wish to run an environment other than development, simply type:node app.js -e <EnvironmentName>
replacing
<EnvironmentName>
with the name of the desired environment.