Skip to content

Commit b6b4b04

Browse files
committed
static routes; dependencies for cassandra gemini
1 parent 603e02e commit b6b4b04

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const serverOptions = {
2020
const app = new Koa();
2121
const router = new Router();
2222

23-
router.get("/", (ctx, next, ...args) => {
23+
router.get("/api/hello", (ctx, next, ...args) => {
2424
// ctx.router available
2525
ctx.body = "hellooo";
2626
});
@@ -37,7 +37,9 @@ app
3737
skip: (req, res) => res.statusCode < 400
3838
}))
3939
.use(serve(`${__dirname}/public`))
40+
.use(serve(`${__dirname}/node_modules`))
4041
.use(router.routes())
42+
.use(async (ctx, next) => await ctx.send(`${__dirname}/public/index.html`))
4143
.use(router.allowedMethods());
4244

4345
console.info(`Starting server @${PORT}`);

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"homepage": "https://github.com/or9/daily-coding-challenge-server#readme",
2323
"dependencies": {
24+
"cassandra-driver": "^4.1.0",
2425
"koa": "^2.7.0",
2526
"koa-morgan": "^1.0.1",
2627
"koa-router": "^7.4.0",

0 commit comments

Comments
 (0)