Comments (5)
Hi @arnaudbesnier ,
I was referring to this block of code inside app.js:
fs.readdirSync('./routes').forEach((file) => {
if (file !== '.gitkeep') {
app.use('/forest', require('./routes/' + file));
}
});
The app is already "using" '/forest' here, so I think defining our routes as just '/brands' instead of '/forest/brands' would work fine.
from forest-express.
Hi @bidhan-a, we'd love to help you. But we need you whole Smart Collection implementation to check that everything looks good.
It might also be one of your express project middleware that could respond 404ย before hitting the custom route you created.
from forest-express.
Hello @arnaudbesnier ,
Thanks for the response. I've actually managed to resolve this issue. I was following along with the documentation on how to define a custom GET route. It mentions the following:
router.get('/forest/brands', Liana.ensureAuthenticated, function (req, res) {...})
But it doesn't work that way. It should only be
router.get('/brands', Liana.ensureAuthenticated, function (req, res) {})
because '/forest' is already defined inside app.js.
from forest-express.
Thanks @bidhan-a ! Cool to see that you made it work.
I don't really understand why the route declaration:
router.get('/forest/brands', Liana.ensureAuthenticated, function (req, res) {...})
does not work as described in the documentation.
What do you mean, saying "'/forest' is already defined inside app.js"?
from forest-express.
@bidhan-a I finally understood your point... Seems to make sense.
I didn't get that you used Lumber to generate your project.
We need to improve the doc about this.
from forest-express.
Related Issues (20)
- How to download remote file from URL in smart action?
- Server events subscription inhibits graceful shutdown HOT 5
- The automated release is failing ๐จ
- [+] Filters - Fields containing enum subfields are not available as filter on the UI HOT 8
- Small crash in forest-server-requester HOT 1
- forestadmin-schema.json created in the wrong directory HOT 1
- Allow setting 'isSortable' on Schema generated fields not only smart fields HOT 4
- SyntaxError: Cannot use import statement outside a module HOT 3
- Cannot login from FA.com: Cannot read property renderingId of undefined HOT 4
- Upload file through API HOT 1
- The automated release is failing ๐จ
- Yarn v2 breaks Schema creation HOT 2
- Allow external endpoint on smart action HOT 1
- defaultValue does not work in smart actions
- Intercom: dates are all in 1970 HOT 3
- The existence of a local in-memory cache object prevents Forest from running on clusters HOT 2
- Using a path in APPLICATION_URL fails HOT 1
- Add Fastify support HOT 1
- How to load the collections statically
- redirect_uri always return http://localhost:3310 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forest-express.