feat(node): move the generated endpoint under /api
This commit is contained in:
parent
6d661cf633
commit
02d01b5ce4
@ -7,7 +7,7 @@ import * as express from 'express';
|
|||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.get('/', (req, res) => {
|
app.get('/api', (req, res) => {
|
||||||
res.send(`Welcome to <%= name %>!`);
|
res.send(`Welcome to <%= name %>!`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import { AppModule } from './app/app.module';
|
|||||||
|
|
||||||
async function bootstrap() {
|
async function bootstrap() {
|
||||||
const app = await NestFactory.create(AppModule);
|
const app = await NestFactory.create(AppModule);
|
||||||
|
app.setGlobalPrefix(`api`);
|
||||||
const port = process.env.port || 3333;
|
const port = process.env.port || 3333;
|
||||||
await app.listen(port, () => {
|
await app.listen(port, () => {
|
||||||
console.log(`Listening at http://localhost:${port}`);
|
console.log(`Listening at http://localhost:${port}`);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user