I will create a separate API folder in my root directory which will contains its own routes/ and controllers/ folder but the models/, services/ and lib/ folder will be in the root directory shared by both website and API. And then
Import apiRouter from './api/routes/index'
Import genralRouter from 'routes/index'
app.use('/api/', apiRouter)
app.use('/', generalRouter)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I will create a separate API folder in my root directory which will contains its own routes/ and controllers/ folder but the models/, services/ and lib/ folder will be in the root directory shared by both website and API. And then
Import apiRouter from './api/routes/index'
Import genralRouter from 'routes/index'
app.use('/api/', apiRouter)
app.use('/', generalRouter)