Peel and finely chop the onion and put in a frying pan over a medium heat with the olive oil. Allow to soften for 2 minutes.
Add the spinach - let it wilt then take off the heat. Leave to sit for 30 minutes, then drain away any excess moisture.
Cut the puff pastry into 4 equal sized rectangles.
Beat the egg in a small bowl.
Spoon 1/4 of the spinach mix onto one half of each of the pastry rectangles. Top with 1/4 of the brie, then brush around the outside of the pastry rectangle with the egg. Fold over, pinch down the edges with the back of a fork and transfer carefully to a baking tray.
Bake in the oven for about 20 minutes, until the pastry is risen and golden brown. Tuck in!