feat(node): move the generated endpoint under /api

This commit is contained in:
Victor Savkin 2019-02-07 10:07:24 -05:00
parent 6d661cf633
commit 02d01b5ce4
2 changed files with 2 additions and 1 deletions

View File

@ -7,7 +7,7 @@ import * as express from 'express';
const app = express();
app.get('/', (req, res) => {
app.get('/api', (req, res) => {
res.send(`Welcome to <%= name %>!`);
});

View File

@ -9,6 +9,7 @@ import { AppModule } from './app/app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.setGlobalPrefix(`api`);
const port = process.env.port || 3333;
await app.listen(port, () => {
console.log(`Listening at http://localhost:${port}`);