Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
WebAPI_Backend/docs.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20 lines (16 sloc)
617 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file 304CEM Writers Collective OpenAPI Docs Server | |
* @author Bethany Hill | |
* @version v1 | |
* @description This file initialises the docs server and mounts its static paths. | |
*/ | |
const Koa = require('koa'); | |
const serve = require('koa-static'); | |
const mount = require('koa-mount'); | |
const app = new Koa(); | |
app.use(mount('/', serve('./docs/jsdocs'))) // serve JSDocs | |
app.use(mount('/openapi', serve('./docs/openapi'))) // serve OpenAPI | |
app.use(mount('/schemas', serve('./schemas'))) // serve schemas | |
let port = process.env.PORT || 3030; | |
app.listen(port); | |
console.log(`OpenAPI server running on port ${port}`) |