Skip to content

Commit

Permalink
[Feat] User service init
Browse files Browse the repository at this point in the history
References #61.
  • Loading branch information
angel-penchev committed Feb 8, 2021
1 parent d46479a commit 9909901
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions server/services/user-service/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import express from 'express';
import bodyParser from 'body-parser';
import makeExpressCallback from '../../core/express-callback';
import config from '../../core/config';
import {
postAuthenticateSendSms,
postAuthenticateVerifyToken,
notFound,
} from './interfaces/controllers';

const apiRoot = config.apiRoot;
const app = express();
app.use(bodyParser.json());

app.post(
`${apiRoot}/users/authenticate/step1`,
makeExpressCallback(postAuthenticateSendSms),
);
app.post(
`${apiRoot}/users/authenticate/step1`,
makeExpressCallback(postAuthenticateVerifyToken),
);
app.use(makeExpressCallback(notFound));

app.listen(3004, () => {
console.log('Users service started on "/api/users"...');
});

export default app;

0 comments on commit 9909901

Please sign in to comment.