Go Pro Sign Up Login

Buy Now and unlock this series

$

49

.99

$

39

.99

yours forever

Become a Pro and unlock everything

$

24

.99

per month

Scaffolding our API

Now we will start scaffolding out our GraphQL API and build a few queries using Prisma so we can see how it retrieves data.

Downloads

Become a pro to download code and videos

Comments

User avatar

Michael

4 months ago

Do you have any advice for Windows users with respect to development vs production environments and NODE_ENV? When I run this, I get

`PS C:\Code\levelup\prisma\file-manager-api> npm run dev

file-manager-api@1.0.0 dev NODE_ENV=development nodemon app.ts 'NODE_ENV' is not recognized as an internal or external command, operable program or batch file.`

because the dev command does not set the environment in Windows... "dev": "NODE_ENV=development nodemon app.ts",

User avatar

Michael

4 months ago

Having done all that, As a Windows user, I feel like I should just use .Net Core and Entity framework it's much less painful, however it's good to see how the other half live. :)

User avatar

Michael

4 months ago

In answer to my own question, I got this running on Windows 10, but it required two additions.

  1. Change scripts to: "dev": "SET NODE_ENV=development & nodemon app.ts", The & is important.
  2. globally install ts-node as follows: npm i -g ts-node then you'll get a server on port 3000.

Want to join the conversation?

Become a Pro member today!