xonecas.io
4515
Nr

node-react-typescript-boilerplate / commit bc0ec17

Minor tweaks and notes

Sean2023-01-10 bc0ec1750a636233b7f75e645bd53ea51324a6d2 parent ab50508

4 files changed

dist/auth/index.js+1−0
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1111 Object.defineProperty(exports, "__esModule", { value: true });
1212 exports.login = exports.register = void 0;
1313 const client_1 = require("@prisma/client");
14+// @TODO: Use koa-passport + passport
1415 function register(ctx, next) {
1516 return __awaiter(this, void 0, void 0, function* () {
1617 try {
dist/index.js+2−3
@@ -53,9 +53,8 @@ function main() {
5353 app.use(router.routes()).use(router.allowedMethods());
5454 app.use(routes_1.default.routes()).use(routes_1.default.allowedMethods());
5555 // App starts
56- app.listen(3001, () => {
57- console.log("Server started...");
58- });
56+ const port = process.env.PORT || 3001;
57+ app.listen(port, () => console.log('Server listening on', port));
5958 });
6059 }
6160 main()
src/auth/index.ts+2−0
@@ -1,6 +1,8 @@
11 import Koa from "koa";
22 import { Prisma } from "@prisma/client";
33
4+// @TODO: Use koa-passport + passport
5+
46 export async function register(ctx: Koa.ParameterizedContext, next: Koa.Next) {
57 try {
68 const data = ctx.request.body;
src/index.ts+2−3
@@ -48,9 +48,8 @@ async function main() {
4848 app.use(auth_router.routes()).use(auth_router.allowedMethods());
4949
5050 // App starts
51- app.listen(3001, () => {
52- console.log("Server started...");
53- });
51+ const port = process.env.PORT || 3001
52+ app.listen(port, () => console.log('Server listening on', port))
5453 }
5554
5655 main()