Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratap2018 committed Jan 11, 2024
1 parent 6bbda59 commit d6ea117
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions server/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ const HIDWallet = require('hid-hd-wallet');
import bodyParser from 'body-parser';
import cookieParser from 'cookie-parser';
import { walletAuthRoutes } from './routes/walletAuth';
import { port, logger, walletOptions, mnemonic, schemaId, studioServerBaseUrl, jwtSecret, jwtExpiryInMilli } from './config';
import {
port,
logger,
walletOptions,
mnemonic,
schemaId,
studioServerBaseUrl,
jwtSecret,
jwtExpiryInMilli,
} from './config';
import authRoutes from './routes/auth';
import blogRoutes from './routes/blog';
import appRoutes from './routes/app';
Expand Down Expand Up @@ -44,12 +53,11 @@ export default function app() {
expiryTime: jwtExpiryInMilli,
},
networkUrl: walletOptions.hidNodeRPCUrl,
networkRestUrl: walletOptions.hidNodeRestUrl
}
networkRestUrl: walletOptions.hidNodeRestUrl,
};
hidWalletInstance
.generateWallet({ mnemonic })
.then(async () => {

hypersign = new HypersignAuth(server, hidWalletInstance.offlineSigner, hypersignAuthOptions);
await hypersign.init();
app.use(express.static('public'));
Expand All @@ -58,7 +66,9 @@ export default function app() {
app.use(cookieParser());
app.use(express.json());
app.use(express.static('public'));

app.get('/api/health', async (req, res, next) => {
res.json({ status: 'OK' });
});
app.use('/api/app', appRoutes);
app.use('/api/auth', authRoutes);
app.use('/api/blog', blogRoutes);
Expand Down

0 comments on commit d6ea117

Please sign in to comment.