Menu icon Foundation
Multiple Pages in One Foundation Emails Project

Is it possible to serve more than one email from the pages directory via the npm start command in a foundation for emails project?

 

Right now only the index.html in the pages directory gets serve when I npm start. I'd like to have multiple pages in that directory, and the ability to decide which gets served by npm start.

emailfoundation for emails

Is it possible to serve more than one email from the pages directory via the npm start command in a foundation for emails project?

 

Right now only the index.html in the pages directory gets serve when I npm start. I'd like to have multiple pages in that directory, and the ability to decide which gets served by npm start.

Stephen Rust over 3 years ago

Thanks Corey, that's what I was looking for.

Corey Schaaf over 3 years ago

That can easily be done. You'll notice when you do a foundation build or foundation watch via command line that your default browser is launched. 

The url says: http://localhost:3000/

What's it's really saying is in the pages directory serve up the index.html file. Index.html is a default file that all browsers look for in a folder. 

So if you were working two files in the pages directory (obviously there can't be two index.html files) you just need to change the file path in the browser to whatever the file name is in the pages directory. 

If you're file name is my-other-file-name.html (in the pages directory) you can serve that page up by changing the url to: http://localhost:3000/my-other-file-name.html

If you're wanting to serve up something other than index.html first - I'm afraid someone else will have to chime in. 

Hope you find that helpful!