#Medusa Start isn't running custom routes and entities

23 messages · Page 1 of 1 (latest)

vast birch
#

I'm trying to deploy on heroku, I copy paste the scripts as mentioned, but now when I run medusa start and call custom routes, I receive status error 404

rapid dome
vast birch
#

medusa develop

rapid dome
#

and you are using the extender right?

vast birch
#

yeah yeah it was working fine

rapid dome
#

therefore, the medusa develop command will not start your instance using your main file

vast birch
#

scripts were ```

  • "seed": "medusa seed -f ./data/seed.json",
  • "build": "tsc",
  • "start": "npm run build && nodemon dist/src/main.js"
rapid dome
#

you should call start instead

vast birch
#

now they are ```

  • "serve": "medusa start",
  • "start": "medusa develop",
  • "heroku-postbuild": "medusa migrations run",
  • "prepare": "npm run build",
  • "build": "babel src -d dist --extensions ".ts,.js""
rapid dome
#

and create a start:prod for example

vast birch
#

i tried both they didnt work

rapid dome
#

already your start command is for local development,

you should have something like:
"start:prod": "NODE_ENV=production npm run build && node dist/src/main.js or something similar

vast birch
#

I should have that in scripts ?

rapid dome
#

at least something like that yes

#

since the start is different from a classic medusa server since you have a main file which take care of the bootstrap

vast birch
#

ok deal thanks ❤️

rapid dome
#

my pleasure 🙂

vast birch
#

also just one more question

#

how do you create a migration in the terminal ?

rapid dome
#

the migration file?

#

for medusa or the extender?

vast birch
#

extender

rapid dome
#

The extender provides an out-of-the-box application architecture which allows developers and teams to create highly testable, scalable, loosely coupled, and easily maintainable applications.
In also increase medusa extensibility and customisation for special use cases. It comes with handy
decorators approach to increase the DX and full typings s...